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
answers38
viewsPopulate Jsonarray with Sqlite3 data
I have a code that is to send my Android data to PHP in JSON, to save in Mysql. But I’m sending one at a time, I want this code to send one JsonArray at once. Method that sends data by parameters to…
-
1
votes1
answer185
viewsCode review: field validations, how to abstract correctly?
In a Java Swing application I have four JTextFields: Weather minimum of handover of an order in minutes Weather maximum of handover of an order in minutes Weather minimum of withdrawal of an order…
-
1
votes1
answer528
viewsThymeleaf fragments are not inserted
Hello. I am trying to make a simple import of a code snippet via th:insert from Hymeleaf, but something is not going well. From what I read in the documentation, I don’t think there’s anything wrong…
-
1
votes1
answer110
viewsSqlite check if data already exists
Hello I have an application where when logging in if you have internet connection it should bring the data from the web service and enter in the bank. So far so good, but my doubt is as follows:…
-
1
votes1
answer185
viewsCall Activity after thread is executed
I have an app that logs a teacher into a webservice and right after logging in it inserts the user into the android database. If the result is different from null, I want you to call the Activity…
-
1
votes0
answers612
views -
1
votes1
answer93
viewsSecurity rules not recognised by Thymeleaf
Hello. Despite defining the rules for spring security and calling in html in an apparently correct way, permissions are not recognized when running the browser. A user without permission…
-
1
votes0
answers239
viewsHow to convert a Maven project to Gradlew?
I have a Maven project working perfectly and I need to convert to Gradlew how I can do this ?
-
1
votes1
answer124
viewsInterrupt Thread (Java) does not kill execution in Oracle database
Guys, I’m working on a script runner PL/SQL, using the JDBC Statement to make my connections with the bank. My problem is that the project works with Threads and when the user wants to interrupt the…
-
1
votes4
answers300
viewsDoubt about denial operator
Why is it not possible in Java to use the negation operator on an object like Javascript? Is this because Java is strongly typed or is there some other peculiarity? For in Javascript the negation…
-
1
votes1
answer46
viewsProblem with logging in using sqlite
My method is not returning the professor logged in. public Professor autenticarUsuario(String usuario, String senha) { String SQL = "select * from PROFESSOR where USUARIO = ? and SENHA = ? ";…
-
1
votes2
answers578
viewsWorking with two txt files
I have two different.txt files as an example: arquivo1.txt has 1854 lines with 6 numbers on each line separated by " "(a space). In the other file 2.txt I have more than 1 million lines with 6…
-
1
votes1
answer46
viewsJava Reflection nested objects
Hello, good afternoon everyone. I’m studying java Reflection and my question is whether it would be possible and how to pick up nested objects dynamically as in the example below: public class Rg{…
-
1
votes2
answers166
viewsDoubt in the implementation of Actionlistener
I have a college project to make a system of any category that, in this case, I chose a medical system and had something I didn’t quite understand about what the implementation would be like: I have…
-
1
votes1
answer120
viewsLinks within the application
I’m trying to get my app to make an emergency call and call a pre-defined emergency number, but when I open Activity she simply for already looked and redid the code 3 times, but the error persists,…
-
1
votes1
answer135
viewsError accessing method in Managedbean
Guys I’m having problems accessing a method that is in my Managedbean, the idea is the following: I have a page where I list the records that are in db from the click on the "Query" button and then…
-
1
votes0
answers65
viewsCopy Pdf s with itext fields do not appear
I have a routine that generates several pdf s with data from the database, using a template created in Openoffice, this contains several fields that are filled with data from the database, in the…
-
1
votes1
answer249
viewsNo suitable Parent found from the Given view. Please provide a Valid view
Good Morning, I have this mistake : No suitable parent found from the given view. Please provide a valid view. I’m entering the registration view and this returning me this message, tried to fix it…
-
1
votes1
answer101
viewsWhy is the Serializable interface empty in JDK source code?
I know what serialization is and what use it is. I also know when not to use it. I’ve read item 74 of the Java Effect. My question is, what is the purpose of an empty interface, in which there is…
-
1
votes1
answer1645
viewsPaper cutting (trigger guillotine) on Bematech MP-4200 TH printer
How to make the Bematech MP-4200 TH (non-fiscal) printer cut paper at the end of printing in a Java application?
-
1
votes1
answer69
viewsCondition Else being called at the wrong time
I’m currently having problems with a work code. My ELSE class is always running, but only when I choose the option for the first IF. import java.util.Scanner; public class BikeFit2 { public static…
-
1
votes2
answers926
viewsHow to Print a list of numbers summed in sequence?
Program: public static void main(String[] args) { List<Long> lista = new ArrayList(); long k = 0; for (long a = 1; a <= 10; a++) { k = k+2; lista.add(k); }…
javaasked 8 years ago Rafaelzinho 85 -
1
votes1
answer603
viewsProblem when entering data into mysql database by java
My java code is working, but when adding data to an SQL table, the fields are being populated as NULL, even though added values. Part of the code into which the insertion occurs: public void…
-
1
votes0
answers26
viewsObjects not being serialized - For XML - Java
I need to make a requisition SOAP with the completed Group : <EncerraAgendamentoAuditoria xmlns="http://tempuri.org/"> <lstrIDProcessoUnico>string</lstrIDProcessoUnico>…
-
1
votes1
answer41
viewsHow to remove Videoview buttons? Android
I’m trying a way to take or hide the buttons of a Videoplayer (forward, pause, back) on android, because the video is part of Splashscreen public class Splash extends AppCompatActivity { @Override…
-
1
votes1
answer206
viewsConvert EJB and WEB modules to Maven
My project consists of three modules: EAR, EJB and WEB. I know Maven goes way beyond dependency control, but to start I just want to use it to control dependencies. I tried to convert the modules…
-
1
votes1
answer535
viewsGeneration of Billets with Bopepo
I have a system that generates an accounts receivable, and I am trying to implement the generation of bank slips, my teacher Advisor indicated me the tool 'Bopepo' Jrmum. I entered in my system and…
-
1
votes1
answer146
viewsWhy does it loop infinitely in the println?
Build a program that is able to average all entire or actual arguments received from the keyboard and print them. Invalid arguments should be disregarded (Print a message for each invalid value. ),…
-
1
votes2
answers327
viewsHow many times will the x variable be created at the end of the loop? Why?
In the following loop, how many times the variable x will be created at the end of loop? Why? for (int i = 0; < 10; i++) { double x = i + 10; System.out.println(x); }…
-
1
votes0
answers189
viewsCommunication Failure while Joining agent Platform: No ICP active - JADE
Hello could help me with this, I’m starting now in JADE, and I’m trying to start two agents, however gives the following exception: Communication failure while joining agent platform: No ICP active…
-
1
votes1
answer197
viewsJava method show dates in a loop
Good evening, I have a method where I receive the amount of installments and start date. I want to add 1 month to this initial date in loop and I’m confused, giving a very different value: public…
javaasked 8 years ago Marcia Pereira Reis 451 -
1
votes3
answers209
viewsCan the "main()" method be overwritten or overwritten?
I read the answer What public Static void main(String[] args means)?, but I still have two doubts about the method main(): The method main() can be overloaded? The method main() may be…
-
1
votes0
answers32
viewsrequestContext works with JBOSS-EAP -4.3 version and does not Works with JBOSS-EAP-7.2 version
We will migrate the JBOSS-EAP-4 server to the JBOSS-EAP-7, using the JBOSS-EAP-4 the implementation of the Ajaxlistener class behaves smoothly, when migrating to the JBOSS-EAP-7.2 the implementation…
-
1
votes1
answer213
viewsThread calling method to query a web service always returns null
When I call this method to follow in another class it is returning null. However I have already performed the debug in the line "Return listNotes;" and it’s being filled normally. Method code:…
-
1
votes1
answer212
viewsFill in textview android studio/sql server
Good guys, can’t fill a textview using a sql server database. Can anyone help me? Here’s what I have on onCreate: connectionClass = new MainActivity(); text = (TextView)…
-
1
votes1
answer3340
viewsMethod Difference with Getmapping and Requestmapping
Good morning guys. What’s the difference between the methods below and what should I be following in developing Java Web applications…
-
1
votes3
answers1429
viewsEdit an already created XLS file
I need to edit an XLS file already created, but I am only able to create a new file and delete the old one, so far it is working but I wonder if it is possible to edit the old file and not have to…
-
1
votes1
answer49
viewsException in thread "main" in String array
I would like to add the text inserted by the user in a vector position, but it is giving error... why? public static void main(String[] args) { int cont=0; String inserida =…
-
1
votes2
answers124
viewsWhen making the class diagram is it necessary to add all methods and attributes?
I have several classes that have several attributes and methods. When making the class diagram it is necessary to add all methods and attributes? Is there any rule or consensus on the creation of…
-
1
votes0
answers129
viewsError query Nfce SP webservice
After upgrading to version of java 8 I have error to query status of Nfc-and SP webservice (https://homologacao.nfce.fazenda.sp.gov.br/ws/nfeconsulta2.asmx), always returns to me "HTTPS hostname…
-
1
votes1
answer40
viewsDifference in Declaration of a @Generatedvalue Class
What’s the difference when I declare a class informing the @GeneratedValue(strategy = GenerationType.IDENTITY) and not informing, since the database manager will coordinate the primary key? I’m…
javaasked 5 years, 7 months ago Josemar Sabino 77 -
1
votes2
answers84
viewsJAVA + HIBERNATE
I started using Hibernate and I am very lay in the subject, what I really want to know is: When we map a class for Hibernate to automatically create the table in the database, it is possible to…
-
1
votes1
answer73
viewsCreate Next button
I’m having a problem that I haven’t found any solution, I’m trying to create a forward button to pass the pages of my file. pdf that is displayed on my JSP page. String arquivo = ""; String i = "";…
-
1
votes1
answer1014
viewsResultset first does not work
I am creating a Java application in Eclipse. I’m having trouble making the First, Previous, Next and Last buttons work. I’m stuck on the button First, because I believe the difference is just the…
-
1
votes1
answer653
viewsPick row reference in table with JSF(Primefaces)
I have a scenario that presents something weird and I don’t understand why this behavior. Using JSF with Primefaces, I have a Datatable with some (several) values that comes from the Database and…
-
1
votes1
answer88
viewssplit does not return array with the string elements
I’m having trouble using the method split, that is not returning me the array with the elements of the string. public class Teste{ public static void main (String[] args){ String s = "0.101110";…
-
1
votes1
answer140
viewsAES JSF encryption
I have a problem with Seguinte, I have an AES encryption algorithm. When I run it by main it works, but when I run it on a jsf page and decrypt the text it returns several ???? when it contains…
-
1
votes0
answers67
viewsError with Sessionexpirationscheduler in widfly
When I changed the jboss all to use Shared Session, my application after a while starts from that error below, someone knows how to solve? 12:08:40,332 WARN…
-
1
votes1
answer139
viewsError while publishing Java 7 - Java 7 vs Java 8
I rented a VPS server and when trying to connect my android application with Java EE, I received the following message: type Exception report message app/server/CSelerServer : Unsupported…
-
1
votes1
answer279
viewsError trying to insert data via JSF-Bean Error
I’m starting to create a web application using JSF, but I try to insert some data through a form and it displays the error below: /usuario.xhtml @19,72 value="#{usuarioBean.email}": Target…