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
votes0
answers46
viewsApplication does not starta struts2 and spring4 listeners
I’m using struts2 + spring4 server-based jboss 7.1 on my application. As reported in the title, I’m not getting up the application because the listeners They’re not being squeezed. Someone can tell…
-
1
votes1
answer810
viewsMysql backup by java
Good afternoon, I have a cmd that correctly backs up my database, but when running in java it does not open the cmd in the expected way, it follows the code: package sistemaMiriam.backup; import…
-
1
votes0
answers92
viewsPersisisntece.xml configuration with Glassfish datasource
Next people I made 2 glassfish datasources!!!! Where the first is a fixed database!!! Follow picture: This datasource is working correctly !!! My second I do not pass the Database property because…
-
1
votes2
answers596
viewsPath to JSP image
I need to display an image inside the tag img. It is a web project, running on Tomcat and Ubuntu Mate. I saved in bank as String the path to where the image is: "/opt/imagens/img.png" To display, I…
-
1
votes1
answer465
viewsCompetition with thread and database inserting duplicates
I have the following problem with competition using Thread. The code below should take the last number of a column of a table and add +1 to save again in the database, the problem is that this…
-
1
votes1
answer580
viewsHow to send an object between controllers via Redirect
How to send an Object through redirect between requests? I performed tests trying to send the object through the model, but without success. Follows the code: @RequestMapping("removeResultado")…
-
1
votes1
answer628
viewsAdd line with empty fields in a Jtable
I have a AbstractTableModel only that I do not know how to add blank lines, when pressing the add line button on my frame I want it to call a method called addLine() of my Modelotabela, someone can…
-
1
votes0
answers31
viewsThere is way for an entity to belong to a user in Hibernate
I am looking for a simplified way to link a bank entity to a specific user, who registered, in such a way that it does not need to set the field at the time of registration. Is there any simplified…
-
1
votes1
answer150
viewsHow to add Actor on a Screen with Libgdx?
I’m not able to add actors (Actor) on a screen.I want to show an actor in the "Screenmenu" and nothing happens (the actor does not appear), follows me code: Mainclass.java. public class MainClass…
-
1
votes0
answers225
viewsChange JPA/JPQL record
I am doing my first WEB project and I have a question about using JPA/JPQL/MERGE. The doubt is as follows: I need to change a record of a table, I created a datatable that returns to me a list of…
-
1
votes0
answers147
viewsProblem starting the Tomcat
good afternoon I have the following problem on my production server. I already installed Tomcat 8 and 9 to test, JDK 8, I set everything up straight (I believe) and one of my projects does not go…
-
1
votes0
answers657
viewsError Handling for foreign key violation-java-postgresql
I created a table license plate, and 5 tables of materials, both are linked by foreign key, and within my program has a screen to simulate a student’s enrollment, where one of the steps is to choose…
javaasked 8 years, 7 months ago Edivan M.N 23 -
1
votes0
answers229
viewsTomcat stops working on a pc after a short while
So I have a web application (Java + Spring + JPA) on Tomcat 9.0 and several machines connected on it, mobile phones and laptops, all working perfectly. However, there is a notebook (i5, Windows 10…
-
1
votes1
answer29
viewsMultiple Scheduled Tasks in WSO2
I’m trying to schedule two tasks on WSO2. I created the two xml files in the "tasks" folder in the ESB project but only one is being loaded at deploy. I am running on only one node. There are some…
-
1
votes0
answers111
viewsDoes the Jlayer Basicplayer API not open mp3 with Inputstream?
Hello everyone would like to know what’s wrong with my code. The Basicplayer library opens mp3 if you use File but do not open mp3 using Inputstream! That’s right? public class BasicPlayerTest…
javaasked 8 years, 7 months ago Marcos Marcos 19 -
1
votes0
answers122
viewsHow to include Prelude.jspf in java config spring boot
I am migrating a Spring MVC 3 application to Spring boot, this application had its web.xml with the Prelude.jspf configuration where it contained all the jsps JSTL Imports. I want to migrate this…
-
1
votes0
answers38
viewsDoubt Jboss Data Virtualization
Good evening, I am with a project where I have to consume tables generated in star format, for use of BI, the company bought a paid tool, but do not want to spend much on licenses. Therefore a user…
-
1
votes1
answer996
viewsConvert an entire number to a float with decimals
How can I turn a number: 5 in: 0,0005 10 in: 0,0010 I’m trying this way: int numero = 5; float numero2 = Math.abs(numero / 10000); But it’s returning to me like this: 0.0…
javaasked 6 years, 11 months ago user92401 -
1
votes1
answer651
viewsScript for Telnet
How to create a script with previously established commands for Telnet? In the company where I work, we use Telnet daily to configure Onus, however, because we do not have a programming team, it is…
-
1
votes1
answer156
viewsQuery ORDER BY dynamics from the selection of a combobox
I’m developing an application on java managing a database. This application primarily performs a SELECT the database, then submitting the ResultSet for an editable table. I tried to add a comboBox…
-
1
votes1
answer421
viewsDisplay confirmation when trying to close a Jinternalframe
I’m creating a program using JInternalFrame, but would like to request a confirmation in case the user click the close button "Closable". For that, I’m trying to overwrite the methods…
-
1
votes1
answer773
viewsHow to save image in database?
I am developing a web application using the play framework, in which I am finishing the CRUD of a user, however this missing only the part where the user saves his profile photos in the register. As…
-
1
votes0
answers312
viewsProblem deserving Json object with Vraptor4
Good afternoon Personal. I am having problems deserealizing json object with Vraptor4. Taking some tests, you realize a situation: I am using Curl only to test the service, but when I do this…
-
1
votes3
answers314
viewsHelp how to take the last word of a string and add it to the top using java
I have a full name: Jais Pereira Guedes Godofredo The example below, I get the last word, but how to print with this result: Godofredo, Jais Pereira Guedes public class Aula1{ /** * @param args the…
-
1
votes1
answer211
viewsPath ftp directory with spaces
Good morning guys, I’m having trouble getting to a subdirectory on ftp, the name of one of the Ubdirectories has space, and with that I can not advance. I’m doing a project on Java. Could someone…
javaasked 6 years, 10 months ago Fabio Aragão 135 -
1
votes1
answer118
viewsGeneric vector with error
I’m concluding this generic vector activity, but I’m having trouble returning the last and first element of the list. and to remove the element. public class Vetor<T>{ T[] vetor; int…
-
1
votes0
answers131
viewsJAVA Calculator via Socket (Client-Server)
I see you have other cases here on the site, but in my case it’s different, because it needs to be a server that works on this client, with no power alter it. All the server you have here I tested,…
-
1
votes1
answer84
viewsRetrieve Bigdecimal Value from @Pathparam
I have the following call http://localhost:8080/app-teste/produto/1234/76.60 and I want to recover like this: @Get("/{produtoDto.codBarras}/{preco}") public void produtoComPreco(ProdutoDto…
-
1
votes0
answers252
views -
1
votes1
answer94
viewsRemove Edittext date and add five years
I would like to capture a date with a EditText, and from it create another date adding another 5 years. How could I do this?
-
1
votes2
answers167
viewsError with SQL and Mariadb (Current position is before the first Row)
I have a problem in my database and I have no idea what it is. public String getBlockPermission(String blockstring){ String permission = ""; try{ ResultSet res =…
-
1
votes2
answers452
viewsHow to run a Timer class (always) on deployment?
I have a non-web project and I will turn it into a web project using Spring MVC. Today in my method static main of my main class, I create it here: Exec.principalTimer = new Timer();…
-
1
votes0
answers75
viewsSizing of GUI
all good? I’m making my first program in Java. How do I make it visually compatible with any monitor and resolution? I already tried it once and this first time I tried it, I made the components and…
-
1
votes1
answer92
viewsWhat does it mean to put a guy before a statement?
Hello, I was studying HTTP Requests in Java when I came across a code and in a certain line there was a statement a little bit strange to me, someone can explain to me what a type means before a…
-
1
votes3
answers601
viewsJava method that returns difference in hours
Why is the method below returning -1? It should return the difference in hours between two dates. public int diferencaHoras(String h1, String h2) throws ParseException{ DateFormat df = new…
-
1
votes0
answers68
viewsproblems creating timer on EJB
Good night, you guys, I’m having trouble creating a timer, I have no previous experience with applications that run this way. error happens in Cargadados class. follows the timer code:…
-
1
votes1
answer558
viewsHow to use arrow keys, like up, down, from the keyboard to navigate a list of buttons?
I have these buttons implemented with mouse click, only I wanted the following: that I could navigate through them direction keys up and down and enter through the enter. Does anyone know how it…
-
1
votes1
answer68
viewsgetJsonObject bring specific field
I have an object that comes when selecting a particular button. The object is coming right. System.out.println(filter.getJsonObject("cadastro")); Upshot:…
-
1
votes2
answers93
viewsIs there any way to remove all sysout from a Project?
I’m riding a Webservice and there’s some sysout test to print the variables, and as there are in several different files, I would like to know if there is any way to remove all the sysout of the…
-
1
votes3
answers1290
viewsmask jquery currency
In my xhtml I have 2 input value 1 and 2. The first input works perfectly the jquery mask for currency. More in the 2 input that is in a modal the coin mask is not working. coin function function…
-
1
votes2
answers3151
viewsCheck if an email exists or your email domain
I need to check in Java if an email or your domain exists. I do not mean to treat the validity of the email, using for example regular expression, but rather actually check if there is an associated…
-
1
votes2
answers159
viewsHow to pass the answer received by Volley to a Global variable?
Good afternoon, I was wondering how I could spend one JSONObject received in Volley for a global variable: public class ReceberObjeto { private JSONObject res; public ReceberObjeto(String URL,…
-
1
votes1
answer95
viewsJsoup not returning any value
I have a problem with blibioteca Jsoup, that when I try to make the connection to a certain page, it simply does not return me any value from the connection. public static void main(String[] args) {…
-
1
votes2
answers111
viewsWhy doesn’t a private method go into the documentation in Java?
Why when a method has one void as modifier it does not appear in the documentation? As soon as I put the public it appeared in the documentation. Is there any other modifier that interferes with…
-
1
votes2
answers427
viewsAdd results and display separately within the loop
I would like to know how to add up several results. I’m creating a simple application for a particular financial challenge. For example: double salario = 1500; double desafio; for(double mes=1;…
javaasked 6 years, 10 months ago Maurício Maciel 27 -
1
votes1
answer65
viewsJtables Simultaneos
Hi, I was wondering if there’s a way to select 2 Jtables simultaneously, I’ll explain: i need some columns of my Jtable, do not change when the horizontal Jscrollbar is changed, according to my…
-
1
votes1
answer354
viewsError connecting to Mysql
I took an example of the internet to connect with Mysql private static final String USUARIO = "root"; private static final String SENHA = "123456"; private static final String URL =…
-
1
votes1
answer206
viewsJavafx progress indicator in interface construction
I need to create a progress indicator so that the user has a sense that the program is running something from behind. Briefly I want to upload images to a TilePane grid gallery style, however when I…
-
1
votes0
answers55
viewsDemoiselle Appletexecute error in manual
In the Demoiselle documentation of the link: http://demoiselle.sourceforge.net/docs/components/certificate/reference/2.0.0/html_single/#applet-configuracao To create the example applet, add the…
-
1
votes1
answer72
viewsError running Function in PL/SQL
Code CREATE OR REPLACE FUNCTION BuscaNome RETURN t_name IS t_name VARCHAR(20); BEGIN SELECT T.DS_TURMA INTO t_name FROM TURMA T WHERE T.CD_TURMA = 13; RETURN t_name; END; Error: Error: PL/SQL:…