Most voted "java" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the Java programming language. Java is a class-based, statically typed, reflective, and execution environment (JRE) language. Java programs are compiled to bytecode and run on a virtual machine (JVM), allowing a "write Once, run Anywhere" philosophy (WORA).
Learn more…14,468 questions
Sort by count of
-
1
votes1
answer32
viewsHow do I create a simple multiline accordion with Java and Totalcross?
I looked at their example on github but they show how to do a kind of input (a multiedit) for the person to type and not a label with multiple lines.…
-
1
votes1
answer318
viewsHow to form a JSF with a field that can have as many values as needed?
Taking into account the following entity class: import java.io.Serializable; import java.util.List; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import…
-
1
votes1
answer374
viewsHow to order a table using Collections?
I’m developing an application similar to the Olympic medal board. I’ve done the classes and the table with the countries and their medals. Now I’m hooked on the part I need to organize the table by…
-
1
votes2
answers1103
viewsSend selected record from a p:datatable to the form, jsf primefaces
Hi, I’m new here, and I’m migrating from Struts 1 to JSF. I am developing in JSF a user registration screen. I would like it when I select a record from p:dataTable, the data from that selected…
-
1
votes1
answer294
viewsHow to apply a Jdatechooser two filter to a Jtable?
I need to filter the data simultaneously to be displayed in a JTable. Consulting some old questions I managed to solve part of my problem. I have a DATE field in the String type table and I have two…
-
1
votes2
answers795
viewsDifference between Comparator and Comparable
In Java, what is the difference between these two interfaces, Comparator and Comparable? When to use one or the other?
-
1
votes1
answer52
viewsIn totalcross, how to show a popup when I click a button inside a accordion?
I have an application with Totalcross, I am using accordion and within each App I have an update button, how do I make when click the update button a popup with a message "Updated data" appears? I…
-
1
votes1
answer281
viewsHow to convert Curl request to java (Android)
I hope to convert the example below into CURL for Json in Java/Android. The IUGU API accepts JSON or XML. I tried several examples on the internet, but to no avail. CURL: $ curl…
-
1
votes0
answers64
viewsModify <Li> tag symbol in PDF generated through iText
Kind of confusing title, but the problem is somewhat simple. I am generating a PDF through iText and I am using HTML for being simpler. I am performing the example below the only problem is that I…
-
1
votes1
answer97
viewsCombine Rowfilter.andFilter with Rowfilter.orFilter
I have a project that has a table and items to be filtered. They are a categoryJComboBox, an id JTextField and a date interval JDateCooser. I made all filters separately with RowFilter.andFilter and…
-
1
votes1
answer753
viewsupload images + web service php
Good people, I’m a little behind on my CBT because I can’t upload the image. What I have hj worked and take the photo, save in the gang sqlite the path and latitude and longitude, however I have a…
-
1
votes0
answers21
viewshow to create a generic method
Many times I have to make a method to search in a table, for example getByCPF. I would like to make a generic method that I pass the name of the column and what I seek. getByColumn(String column,…
-
1
votes1
answer26
viewsSwipelayout java android error. When I put, gives application error!
I’m wrong in this code in my application for Android, gives error: package fabiohcnobre.hotelcolonialdosnobres; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import…
-
1
votes2
answers1470
viewsHow to search using jpa with searching for foreign key
I am trying to perform a search with jpa, I am with the following query: String jpql = "Select m from Medicamento m where m.usuario_id = ?1"; but this error occurs: Exception in thread "main"…
-
1
votes1
answer442
viewsPrimefaces autocomplete does not pass value to the bean
I have a problem with the Primefaces autocomplete component. The value parameter is not being passed to my bean. private String filtroClientes; public List<String> listarFiltroDeClientes() {…
-
1
votes1
answer144
viewsPlace a table created in an existing container
need help! I’m developing an application in college that will use Bubblesort - yes! We had the misfortune to catch this one! - to draw some data within a table. I created the table through a class…
-
1
votes1
answer1244
viewsHow do I change the Look and Feel of an app?
Can anyone explain to me how I change the layout of my application windows? I was building the app and testing by the method main normally, but since it took me a long time to wait to connect to the…
-
1
votes1
answer67
viewsRefresh page inserts again
I’m starting web development with java and I’m doing some tests and I came across the following situation, I created a form that loads a list based on every click of the button, however, when I…
-
1
votes1
answer1845
viewsHow to change the color of a Jmenubar?
Is there any way to change the color of background and foreground from the java menu bar? I searched several forums and tutorials and could not find a way to change the menu bar color. Following…
-
1
votes1
answer1447
viewsDesign Patterns in Spring Boot projects
In the last 12 months I have worked and studied to learn how to create REST Apis with Spring boot, before that I worked with php MVC programming to create web systems and now in this my "migration"…
-
1
votes1
answer167
viewsConfiguration error on JPA and Postgresql connection
I am having problems connecting JPA with Postgresql. I believe the problem is in the configuration of the application. I am using the Java 8 version, and my pom.xml file is: <project…
-
1
votes1
answer1497
viewsNeed to stay using android studio to program in React
You need android studio to program in React Native? My machine does not run the program well, can barely use it actually. While the emulator I can test the apps by mobile without problems. I’ve been…
-
1
votes1
answer67
viewsPrecedence in Query JPA
I’m using the notation @Where(clause = "ts_removed is null") in my entity. If I insert a method with @Query(value = "XXX") in my repository, the query will overwrite or use my Where clause inserted…
-
1
votes0
answers17
viewsDragevent x Motionevent android studio
Hi, I would like a help: I need to insert in my apk the effect of dragging and playing an item (image, text, icon) in the trash, equal to the function that is already configured in s smarthphones or…
-
1
votes1
answer633
viewsSelect Returning Null from Database
I am trying to make a Login page and am using JaVA,JPA,WIldfly,Primefaces and in the database MYSQL. I’m passing the name and password, but at the time of inspecting it returns me null, by playing…
-
1
votes0
answers50
viewsArbitrary Java/Hibernate Specialized Entity Load from Associations
So, next ... I have the following class structure that treated by Hibernate: ( <|- is a symbol to denote inheritance, 1 --* is a symbol to denote an association one for many) [Pessoa] <|-…
-
1
votes1
answer334
viewsTimer with the Chronometer
I’m developing an app and it uses the timer by clicking on play to start and pause it to pause, only when I click again on play he Zera, would have how to keep counting the time? java code: public…
-
1
votes2
answers767
viewshow to create a vector vector?
Can anyone tell me how to create a vector in java? i.e.: How to make a vector store other vectors with int values this loop populates a vector with values from 1 to 4 q are directions N=North,…
-
1
votes1
answer83
viewsData problem in mysql and java
I’m trying to use the date of a jYearChoser and a jMonthChoser to search for a full month sale, already tested at the Mysql prompt and worked perfectly with the command below: SELECT…
-
1
votes2
answers601
viewsUnable to build Entity manager Factory ( Hibernate JPA )
I am trying to make a connection with Hibernate and JPA, but when trying to create the connection or persist some data it executes the following error: Dec 04, 2018 2:02:45 pm…
-
1
votes0
answers206
viewsTableview with Checkbox - Javafx
I’m filling in the TableView with a ArrayList<HashMap<String, Object>> and I’m not using a model table but getting the data from ArrayList. By marking the CheckBox, need to get the data…
-
1
votes0
answers57
viewsHow to generate an android module . jar?
Hello I have an android app with a module and would like to turn it into a . jar to be repurposed in other projects. How do I do this?
-
1
votes3
answers1043
viewsDelete registration form, JSF Primefaces
I’m using JSF with primefaces. I have a registration screen, and I have a button to delete the form data, would be a button to clear the form to make another registration. However, this wipe button…
-
1
votes2
answers117
viewshttpget + URI + Httpclient libraries discontinued. How to update code?
I need to access the API Panoramio to fetch some images according to the sent coordinates. However I am having trouble receiving the JSON value. After several searches, all indicate code identical…
-
1
votes0
answers55
viewsJava Spring, error authenticating with active Diretory
Hi guys, in my company we implemented an active Diretory environment, and we were asked to develop an application that authenticates there, the environment is already created and the guy from the…
-
1
votes0
answers1054
viewsJava ZIP Address Search
Good morning, you guys! I have a zip code search engine that is no longer working. When I use the URL passing my zip code it returns the query. Thanks for the help! Here is a example link to test…
-
1
votes0
answers236
viewsProblem with sockets when closing client: java.net.Socketexception
Hello, good morning, good afternoon or good evening, I’m having a problem, with a system I’m creating, I thank anyone who can help. Then, this system basically passes a "protocol" to the server and…
-
1
votes2
answers559
viewsHow to handle an empty string?
I need to convert a string taken from a text file and fill in a person class where, each attribute of the class is separated by "," in the text file. Attributes are only: height, weight, age. In the…
-
1
votes0
answers56
viewsPerform an action automatically when you open the app
I am working on the development of an app and I have a question, I need my app to perform an action when opening it. Can anyone tell me how to do that? I’ve looked and I can’t find anything about…
-
1
votes1
answer290
viewsAdd months to a Calendar without modifying the original instance
I am implementing a system in which I set a specific date in a type variable Calendar and then I need to manipulate her. I would like to take the value of a few months added: Calendar calendar =…
-
1
votes0
answers41
viewsDynamic fragment
I have the following problem when the screen is changed to 3 tabs and then back to 2 tabs these two tabs are blank without content anyone could help me? The code is not showing any error, when I…
-
1
votes1
answer122
viewsComparison of JAVA dates
Good people I have a array of strings with dates, coming from a query with Firebase database. I want to organize it increasingly. Ex: 05/09/2016 - 06/09/2016 - 11/11/2016 Dates are entered in my…
-
1
votes1
answer1630
viewsSequential list implementation exercise
I’m trying to solve this college exercise that I’ve already implemented a lot of, but there are still three things missing. It’s about data structure with Java OO - sequential list. Follow the code…
-
1
votes1
answer81
viewsBrowser does not reload last page
My application is a simple web browser unique to my site, however I am facing a "problem" that is irritating. It is the following, I am using the application in good ai I leave in the background and…
-
1
votes1
answer185
viewsInsert website data into sqlite
I have a webservice that returns to me the following data Codigodisciplina, Disciplina, Codigoturma. Starting from a principle that the teacher can have more than one discipline, for example,…
-
1
votes0
answers341
viewsBarcode Ireport, Barcode 2int5
I built a new custom layout that we received by webservice I used Ireport 6.3.0 When I print the barcode gets distorted The variable that the barcode receives the value is of type String The value…
-
1
votes1
answer124
viewsDifference between using a Stream or Collection
I see that the use of stream Java 8 is recommended for large amount of data. If the data set is small, there is some gain from using only Collection?
-
1
votes2
answers275
viewsReturn values using Dialog’s
I have the following method dialogConfirme in which it contains a custom dialog declared as public static to return a value of the type boolean. The issue of static is so I can call any class using…
-
1
votes1
answer100
viewsError in query syntax in Preparestatement
I’m getting this error message and I can’t find why: You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right syntax to use near '?,? ,? )'…
-
1
votes1
answer337
viewsEclipse Maven | lambda | use -source 8 or Higher to enable lambda Expressions
Java Maven project in Eclipse neon (4.6.0), simply does not compile when using lambda. The mistake: use lambda Expressions are not supported in -source 1.5 (use -source 8 or Higher to enable lambda…