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
answer118
viewsIncrement in Java vectors
I am having doubts about some lines of a code, I will put them in the form of a comment. Follows: import java.util.Scanner; public class Teste131 { static final int max = 100000; public static void…
-
1
votes0
answers963
viewsUse of module-info.java
When the Eclipse creates a module-info.java what would be? How should I employ? In places where I seek nothing is synthesized.
-
1
votes2
answers1070
viewsRegular expression for alphanumeric characters, hyphen, space or single quotes
I’m looking for a regex that accepts alpha-numeric characters, spaces, ' and -. These examples should be accepted: "Jean-da Silva", "Carlos 2", "João d'lango". Examples not accepted: "J@ão",…
-
1
votes1
answer74
viewsBest Scenario: Recording n table for n Hibernate
I have some doubts about recording records in tables from N to M. My scenario is this:: In my bank when I insert a doctor in the table "Doctor" the medical record, and in "Doctor x Specialty" the…
-
1
votes0
answers9352
viewsHow to Change the Language of Netbeans IDE 11 on Windows 10
As we can see in the IDE photo is in English. The compiler too, but I want to modify to Portuguese-Brazil. I checked the file netbeans.CONFIG which is in the folder C:\Program…
-
1
votes0
answers510
viewsExcel with more than 300 thousand lines
Good evening, I have a problem with Excel. The spreadsheet has more than 300 thousand lines and when I run the application with 30 thousand lines I have no problem. The error only happens with files…
-
1
votes0
answers33
viewsHtmlunit - Htmlpage with special characters and different formatting
Use Htmlunit and when I give a Webclient.getPage() to a url, I get one Htmlpage thus (htmlPage.asXml()): <?xml version="1.0" encoding="ISO-8859-1"?> <html> <head> <script…
-
1
votes1
answer31
viewsWhen overriding a method should I call the super implementation before or after my code?
Watching and researching some tutorials on the internet, I came across some code in JAVA on ANDROID, as below: @Override protected void onPause() { sensorManager.unregisterListener(this);…
-
1
votes2
answers233
viewsVariable is not being found
Why the following program does not work? package javaapplication1; import java.util.Scanner; public class Exemplo008 { public static void main(String[] args){ Scanner teclado = new…
-
1
votes1
answer57
viewsDoubt About Socket logic
I have a question regarding identifying socket. Let’s assume I have 2 "socket types", a customer and an attendant. Where the 2 chat is done, I can have several clients and several attendants, but my…
-
1
votes2
answers151
viewsHow does Stdaudio work in java?
I’m trying to read the frequencies of an audio, I spent a whole day tending to understand FFT and ended up knowing less than when I started. But in the end I found Stdaudio in java. this Dae:…
-
1
votes2
answers186
viewsHow does Java sync work?
What’s the advantage of having two threads, which run at the same time but which one waits for the other to be completed to be executed? When using the SYNCHRONIZED keyword in a JAVA application…
-
1
votes0
answers28
viewsProblem to import Google libraries in Intelij IDEA
I am trying to use the Google Drive API for JAVA but I am facing problems when importing. The code is working normally, but my import is giving error. Does anyone know what might be happening.…
-
1
votes1
answer346
viewsHibernate does not update information
My problem if it comes to an update unsuccessfully follows the code below. EntityManager manager=JpaUtil.getEntityManager(); EntityTransaction trx= manager.getTransaction(); trx.begin();…
-
1
votes1
answer1116
viewsNullpointerexception: Attempt to invoke virtual method
I’m trying to pass information on a Activity to another through the position on the list, but is giving this error of nullpointer. Where I get the information - Main Activity @Override protected…
-
1
votes1
answer218
viewsCapture webcam images every 1 second using Javacv
A particular programmer is doing a project where the standard webcam takes photos every 1 second using Javacv. For now ,in this code, at the click of the capture button it captures a photo and saves…
-
1
votes2
answers830
viewsIreport Tibco - Error in XML processing: no element found
Hello !! I’m having trouble generating the report ,I’m using jsf,Hibernate,mysql follow my bean. @Named @RequestScoped public class RelatorioBean implements Serializable { private static final long…
-
1
votes2
answers187
viewsAndroid - How to create a comparison so that items from LISTVIEW are displayed or not according to the date?
I’m creating an app that will show open pharmacies on a certain date: I created a listview with 10 lines (pharmacies)... And according to the day of the month certain units will be displayed... or…
java android listview android-adapter simpledateformatasked 4 years, 11 months ago Júnior Moraes 11 -
1
votes0
answers301
viewsHow do I set the path (URL) of a Java web application correctly so there are no 404 (Not Found) errors when the project is in production?
I have a Java web project in which I use the Jersey framework. When I deploy to my localhost (use Tomcat 9) everything works, when I take it to Heroku the app works too. However, when I request a…
-
1
votes1
answer68
viewsTender expression for value assignment on a troublesome iReport variable
Next people, I created a tender expression that based on the values of two variables of the same context ("group"), to bring me a media. But for some reason it is not working and I am doubtful. It…
-
1
votes1
answer683
viewsGson: Jsonobject to Jsonarray conversion error (Jsonprimitive cannot be cast to com.google.gson.Jsonarray)
I am trying to convert a Jsonobject item into an Arraylist and for that I created this function from an example I saw here in the forum: public static ArrayList<Produto> converte(JSONObject…
-
1
votes0
answers37
viewsHow can I automate a dowload of an excel file on the web?
Hello guys I’m having a problem, I wanted to automate a routine would download an Excel file on a certain site, if possible using Python or java, I wonder if there is already a program/code that…
-
1
votes2
answers602
viewsDelete Sharedpreferences created dynamically
In order not to keep redoing requests that have already been brought from the server I persist them using Sharedpreferences... Only they are created dynamically in my app. example: // essa key é…
-
1
votes1
answer219
viewsAndroid Studio - Error:(46, 13) Failed to resolve: me.dm7.barcodescanner:zxing:1.9
Good afternoon, I have a project and I’m trying to implement a QR code reader. so when will I include his lib in the project there in Gradle he gives the following error Error:(46, 13) Failed to…
-
1
votes1
answer448
viewsHow to use the same onClickListener in more than one View?
I’d like to know the following, I have: ImageButton btneditarusuario; and a TextView editarusuario;, by clicking on either of the two starts the startActivity. You can group the ImageButton with the…
-
1
votes1
answer416
viewsAdding JSF in java project
I created a Maven project in Intellij IDEA 2016.2, defined it as a Web Application, and later installed JSF. Before installing the JSF the framework added the index.jsp file, which works normally,…
-
1
votes0
answers64
viewsExample of Jparepository or Pagingandsortingrepository on a primefaces datatable
I am learning a little spring boot and have made an application of user/client registrations, and would like to put in my datatable of the first faces a Lazy pagination. Would someone have some…
-
1
votes2
answers852
viewsHow to Throw the dice of a Jlist into another Jlist that is in another Jframe?
I tried it in various ways, but I couldn’t find a solution. When I click the save button. I want him to throw the dice on that Jlist to the other Jlist that’s in the Other Jframe. "I couldn’t…
-
1
votes1
answer555
viewsMaven causes problem with special characters for ISO-8859-1 files
I have a fully configured Eclipse project and my files. java uses ISO-8859-1 encoding and some other Resource files use UTF-8 encoding. I need to create an archetype from this project. I’ve tried…
-
1
votes1
answer427
viewsError in string to integer conversion
I’m trying to register a client in Android internal comic book. I have a field String where I put the user’s phone. This field I do the conversion to Integer using the parseInt…
-
1
votes1
answer207
viewsInstantiating an entity within another entity: how to do it?
The class Estado depends on the class Pais. What would be the difference between me doing this: And do this? I mean, what’s the difference between me instantiating the class Pais within the class…
-
1
votes1
answer86
viewsWhy is my String names accepting whole numbers instead of letters?
import java.util.Scanner; public class Tp1 { public static void main (String [] args){ final int qtdAlunos = 5; String [] nomes = new String[qtdAlunos]; double[]…
-
1
votes3
answers431
viewsWhat is the difference between float and float[]?
I’m seeing some codes that some exercises here on the site and whenever I see something I don’t understand, I research. In the case now it was regarding the float[] , What is the real difference…
-
1
votes1
answer25
viewsSearch in mobile live element
I’m doing test automation in the company where I work, using Java/Selenium and I’m facing a problem when doing automation in the app, because the structure they use here for development is alive, so…
-
1
votes1
answer404
viewsWhen I push to git, characters with "Place" accents. How to resolve?
I have a project in Java, and for example: Type in some line of my code "Not set", when I push to git it gets "N the set" or something worse. Is there any way to avoid this in any git configuration,…
-
1
votes1
answer88
viewsSend text file to Pgadmin
I need a little help, I’m a beginner.I have to send a txt file that I open in netbeans to a Pgadmin table. If you see the code you will understand me. I tried to put my method that shows the txt…
-
1
votes1
answer81
viewsRemove default message @Pattern JPA
I need a help from you. I am creating a web service in java using jersey and Ibernate. To validate the fields informed by who calls the service I used for one of the fields the JPA @Pattern…
-
1
votes1
answer77
viewsHow to use 'Native' in Java?
In Java we have the keyword native. This keyword allows Java to delegate its execution to C and/or C++ allowing it to do certain things it is not able to. Whereas I know the concepts of C and C++,…
-
1
votes2
answers153
viewsMany to One Hibernate Java
I have 2 entities: Contracts, which has only id, number Additive, which has id, number, contract The additive contract is a foreign key, in the database is working fine works like this: 1 contract…
-
1
votes1
answer165
viewsVraptor Mockito unit test (CDI)
someone can give me a light, how to make the unit tests using Mockito next to the complete CDI of the Vraptor application? I use CDI a lot to control my objects like automatic management of my dao…
-
1
votes1
answer64
viewsNumber of methods per Java class
I would like to know if there is a limit amount of methods per java class, if there is how I should proceed in cases where I need to exceed the limit ?
javaasked 4 years, 10 months ago Renato da Silva 11 -
1
votes0
answers18
viewsUsing a Selenium Browser session in another navigation
I have a project in Selenium that logs in to a site and returns in an endpoint the cookies generated in that login. Another project consumes these cookies and injects it into your own browser to…
-
1
votes1
answer70
viewsHow can I parse an xml that has a vector within another vector?
I have a question about how I can parse an xml that the server is sending me. I can get the data up to the tag Cobranca after this tag has another array that I can’t catch. Follows the one part of…
-
1
votes1
answer516
viewsCreating music player application with Jlayer
I am trying to create a Java application that receives a song through JFileChooser and add this song to a list (ArrayList<File>). But when accessing the file array.getindex(0).getPath(), the…
-
1
votes1
answer1666
viewsResize image to screen size
created a Viewa class where I take two pictures of the drawable folder and draw on the screen with draw method(); public class ViewA extends View { private Bitmap img1; private Bitmap img2; public…
-
1
votes1
answer1673
viewsScanner.nextLine does not pick up information after Scanner.nextInt
I’m having trouble with this code, I’m starting in programming, this is just an activity for practice. I do not understand why when executing the code the field 'Campus' does not allow the entry of…
-
1
votes0
answers70
viewsMask Credit Card with JSF
I would like to mask on the screen the user’s credit card number for this format #######*****####. But when using this Pattern it pushes the numbers to the right and does not replace them. Does…
-
1
votes1
answer69
viewsShare my result
Good afternoon, I created a football refereeing app... and looked on the internet to share the result I found this way(a member here of stackoverflow in English) String message = "Text I want to…
-
1
votes1
answer422
viewsHibernate/JPA - Object is an Unsaved Transient instance
Good afternoon people! When saving a new contract adjustment I have to research other contracts "similar" to what I’m readjusting and readjusting them as well. For that I was trying to use a…
-
1
votes1
answer561
viewsHow to program in java and python together
I see various programs and systems that are programmed in various languages, such as android. I’m trying to program in java along with python, but I can’t find anything about it. I’ve tried to…