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
-
0
votes1
answer2017
viewsHow to break line automatically into a texo component?
I would like when it reaches the maximum number of letters/words on that line, to break automatically. When I put a pizza works smoothly: But when I put more than one pizza the text gets bigger than…
-
0
votes1
answer360
viewsBring all table records with jpa and eclipselink
Guys, I have a question here at JPA. Today I have a method to search the Ufs by ID, as in the example below: public Uf consulta(Integer id) { EntityManager em = getEM(); Uf uf = new Uf(); try {…
-
0
votes1
answer134
views -
0
votes1
answer2054
viewsdatatable does not work properly
I am implementing a datatable in my web project, I have repeated the implementation of the datatable several times to remedy the problem, but without success. The problem is that the datatable…
-
0
votes1
answer367
viewsAttempt to invoke virtual method 'void
Good evening, I am not able to solve the problem, it says it has an unregistered object (null Object Reference), but it does not have to initialize the following code: public void deletar(int id) {…
-
0
votes2
answers854
viewsImageview inside Hbox in FXML file
I’m trying to insert an image into a HBox through a ImageView but I’m not getting it. Fxml code: <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import…
-
0
votes1
answer254
viewsImage upload with Spring and Uikit
Dear implementing upload in my project, I was guided by the project of Algaworks Brewer ( upload the photo of beer), using a front-end framework Uikit The upload is being done, so I could notice…
-
0
votes1
answer127
viewsInclude file in Java project
I have a code that runs routines inside Linux servers and access using public keys. When the project is on my pc (development), everything works because in the code I specify the location of the key…
-
0
votes1
answer177
viewsRest Spring server identifying a point as a regular expression
I have a Rest service with the following method: @RequestMapping(value = "/usuario/{login}", method = RequestMethod.GET) @ResponseBody public ResponseEntity<InputStreamResource>…
-
0
votes1
answer100
viewsFtpclient in passive mode
I have a problem trying to connect FTP. For Filezila, it works normally.... but when I try for this code snippet, it generates the following exception: jAva.net.Bindexception: Cannot assign…
-
0
votes0
answers67
viewsJava Hibernate helps
Persistence.xml <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"…
-
0
votes1
answer202
viewsUse of hashmap to make comparisons
I have the following situation: I get a list of itensVenda, and in it I have associated with Venda. In the Venda I have a list of itensVenda and the Cliente, and in Customer, I have associated a…
-
0
votes1
answer63
viewsHow to work with javascript object
Well I’m having a hard time understanding how to work with an object that comes from my javascript controller, I’ve already done some tests to make sure that this information has gone up correctly…
-
0
votes1
answer32
viewsHow to put a system contact in Edittext?
I’m creating an app where the user will click a EditText which will lead to the system’s contact list, where it will click and the contact name will appear on EditText. However, it is precisely to…
-
0
votes1
answer154
viewsPosition Jcombobox on the screen
I made a combo box, in netbeans by command, and I can’t change it from location (in frame), Bounts values change, but it doesn’t move. I’ve used all kinds of commands (setBounds, setpoint,…
-
0
votes0
answers23
viewsHow do I receive data (int.) from another Activity?
I researched several posts here on stackoverflow and I found none talking about migrating whole numbers, I tried a lot of things but it didn’t work out. I’m a beginner and I probably missed…
-
0
votes1
answer513
viewsStatic, private and final variables
I have a doubt that has been troubling me for a long time: What is the advantage of creating a static and final variable (both private and public)? If I have a primitive variable or simple classes…
-
0
votes1
answer46
viewsDate comparison goes wrong
So I have this code that compares a date to today’s date, but sometimes the dates are as follows: : D/tag: Sat Jul 22 00:00:00 GMT+01:00 2017 <<-Data indicada D/tag: Sat Jul 22 18:57:17…
-
0
votes1
answer1014
viewsincompatible types cannot be converted to
I’m starting to study java and after observing the creation of some objects I decided to try to create my own. already in the first I found this error that I don’t know how to solve "incompatible…
-
0
votes1
answer80
viewsHow to put a successful Alert into a data insertion via ajax?
I am working on a project in progress and what I need to do on it is put an Alert and refresh the page after entering data in the database. The data are being entered through a spreadsheet, that is,…
-
0
votes0
answers266
viewsSQL Server Connection
I’m trying to make direct connection to SQL Server, for testing, but at the time of testing "Register" by clicking the button, the app simply hangs, there’s something wrong in the code? package…
-
0
votes1
answer387
viewsHow to use a Listview inside a Scrollview
Hi, I’m trying to use a Listview inside a Scrollview. The goal is to work similar to other apps that do this, such as instagram and the young nerd. Below my comment will be the code in xml and below…
-
0
votes2
answers215
viewsgetParameter returning the same value
I have a table where there’s a column ID - NAME - ACTION 1 -- USU1 -- VER 2 -- USU2 -- VER 3 -- USU3 -- VER in JSP I am storing the id inside a Hidden input. <input type="hidden"…
-
0
votes1
answer64
viewsHow to place a method value inside a Listview
Good evening, I’m creating an app that generates random numbers for me, only I had an idea that makes it easier for the user.... When he wants to generate more than one block of random numbers, he…
-
0
votes0
answers114
viewsPut update object
What’s wrong with my put? It was supposed to update objects in my database,but it doesn’t work correctly,it doesn’t return any errors,. public String doInBackground(String... arg0) { String result =…
-
0
votes1
answer864
viewsError validating android Studio field
Good morning Everybody, I’m making the following mistake: When trying to validate my fields by clicking the sign up button, the same does no action.. I’m new with android and would like a help.…
-
0
votes1
answer49
viewsGenerate values dynamically in a table
I am listing the number of equipment saved in my system in a table, only that they will not always have saved equipment, I can have an empty table, or incomplete. What I need is to list the lists of…
-
0
votes1
answer70
viewsGenerate table content through click action
I am with a web project that needs to implement functions to generate the content of a table according to the chosen item. For example on my Dashboard I have a tower icon, and below I have a table…
-
0
votes0
answers136
viewsexecute . Jar with administrative privileges (strange errors)
How is it a file. Jar, to run it with administrative privileges, I ran Windows Command Prompt as administrator (with the java -jar command.jar file name) and got the following error messages.…
javaasked 7 years, 2 months ago Giovani Ramos da Cunha 15 -
0
votes1
answer30
viewsTwo spinners that cannot have the same selected value
Hello, I have a code that has two spinners and that if we select an option in one spinner in the other that option ceases to exist , what I did was the following : Whenever you click on the spinner…
-
0
votes1
answer119
viewsHow to reference an object from one Activity to the other?
Good evening, I am developing an application containing several buttons, in which you can drag a button and drop in a certain place already defined in the application, and each button has to open…
-
0
votes1
answer36
viewsHow can I end and resume recording a file using a single Printwriter?
I am working with a small project that performs the reading of data from a spreadsheet, aiming to facilitate the capture of exceptions, I have a class called Log Generator. This class has a…
javaasked 7 years, 2 months ago Lucas Barbosa 15 -
0
votes1
answer152
viewsClean components within a tab
I have a method that cleans my components, however, it cannot clean the components that are inside a Tab. I was trying to apply it this way: if (fieldValue instanceof Tab) { for (Tab tab : ((Tab)…
-
0
votes1
answer533
viewsHow to get communication response using MQTT
I am developing an application which I use the MQTT communication protocol, where my system sends a command to a certain equipment, my equipment is receiving the command and changing the status. The…
-
0
votes0
answers134
viewsUpdate Hibernate
The situation is as follows, when placing the property <property name="hibernate.hbm2ddl.auto" value="update"/>, nothing else works, no query works anymore. log always ends with : jul 27, 2017…
-
0
votes0
answers62
viewsReal-time Audio Processing on android: Thread or Asynctask?
I’m starting to develop an android app that will "listen" to the audio and will draw its waveform on the screen. But the first step I wanted to just "listen" to the audio and show on the screen the…
-
0
votes2
answers55
viewsDuplicate random numbers
I created a class that contains a method that generates a random number from 0 to 61... in my Fragment I instituted within my event of button... My question is, how do I put the amount of times it…
-
0
votes0
answers415
viewsHow to fill in several input fields with data coming from the database?
I have a little problem in my system, I have already registered several equipment in my system, but each equipment has a list of doors. How do I generate inputs dynamically according to the number…
-
0
votes1
answer429
viewsAdd SQLITE data in Java
Guys, I’m having a problem I’m having trouble solving in Java. The intention is to connect to a database SQLite. But I’m having trouble inserting it. Take a look at the code, please. package…
-
0
votes1
answer210
viewsHow do I check the blanks?
It is a math average program, need help to check if the user leaves blank and click the middle do button. package suamedia.project.com.suamedia; import android.os.Bundle; import…
-
0
votes1
answer102
viewsLoop of random numbers
Good afternoon, I’m trying to make a loop of my random numbers.... I have two spinner, one with a choice of how many random numbers and the other how many times it has to appear in a Listview... my…
-
0
votes1
answer29
viewsLogin authentication
I would like my password to compare the email also if it does not exist, but it only does the comparison of the password , how to compare the two together ? if (mEmail.equals(email)) { if…
-
0
votes1
answer487
viewsReturn of JSON array
My JSON returns more than one number. How to receive all and not one? I would like to set the return on one TextView. How to make it return all values and not only the first? JSONObject json = new…
-
0
votes0
answers98
viewsOrdering a Sortedmap by object attribute
Good afternoon fellow programmers on duty. I am developing an application that creates a formulery through the information contained in a tabulato.txt file. I managed to develop the whole routine of…
javaasked 7 years, 2 months ago Alexandre Guerreiro 393 -
0
votes1
answer1020
viewsCreating field with weight format with two decimal places and 3 houses before the comma
I’m trying to create a "weight" field, but I’m having some problems. The weight can vary from 2 to 3 decimal places before the point. For example, it could be 80.00 Kg or 100.00 Kg. However, the way…
-
0
votes2
answers626
viewsConvert json array to retrofit
I have the following return in json { "cardapio": [ { "tipoprato": "SALADAS", "pratos": [ { "prato": "ALFACE + REPOLHO ROXO" } ] }, { "tipoprato": "PRATO PRINCIPAL", "pratos": [ { "prato":…
-
0
votes1
answer189
viewsProgrammatically change specific Tab background
I own a TabLayout in which I programmatically create tabs in this method: mTabLayout.removeAllTabs(); for(int i = 0; i < list(); i++) {…
-
0
votes0
answers47
viewsI cannot Update my Object after being recovered
I am trying to update my form after recovering an object and I cannot. My DAO public List<Contato> listar() { List<Contato> contatos = new ArrayList<>(); String sql = "select *…
-
0
votes0
answers99
viewsComponent Not Rendered By Ajax
I have a form, where internally has a component h message: and a h:inputText, and I am submitting this form by jsf standard ajax... the problem is... when submitting the form ajax does not update…
-
0
votes1
answer691
viewsThymeleaf does not display date in HTML5 component
Hello! I’m starting to study Hymeleaf with Spring MVC and I came across a problem that I can’t solve. I have a date field with the component type="date" HTML5 in a form, which works 100% when…