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
answer993
viewsHow does an Arraylist of Arraylist work? How to resort to an Arraylist of Arraylist?
ArrayList<ArrayList<String>> ArrayList2; How does an Arraylist work? How to resort to an Arraylist of Arraylist?
javaasked 6 years, 5 months ago Adérito Gt 1 -
0
votes0
answers178
viewsUpload images increasing the file size by almost 10x
Good afternoon dear programmers benefactors. I have a problem, as I described in the title, that is affecting my image uploads. The image increases up to 10 times the size. And I’m not talking about…
-
0
votes0
answers23
viewsJSF 2.3 project with delay in initial connection
I am making a system using Java1.8, JSF 2.3, Hibernate 5.4.x and Tomcat 9, with standard MVC and entitymanager. The problem is that to save the first object in a form, it takes about 3 to 5 seconds.…
-
0
votes1
answer670
viewsJDBC connection on AZURE server with SSL encryption
I’m having trouble connecting via JDBC in the AZURE Sqlserver database using encryption. My connection string is as follows: jdbc:sqlserver://servidor.database.windows.net:1433;…
-
0
votes0
answers91
viewsBug reading csv by http request (Webservice)
I am having trouble reading a csv file via http request. It would be a Restful webservice that receives a csv and uses its contents. I’ve tried to read it in different ways, with opencsv, Javacsv..…
-
0
votes1
answer70
viewsSearch string snippets
In a search filtered in java using .startWith (query) for example: I want to search "Military Police" in the search I type "Police" and appears police, ok. If I type "military", does not appear in…
-
0
votes1
answer110
views"android.view.Inflateexception: Binary XM file line" when changing activity
I am currently developing an app for Android and I have a problem that ends up making my program stop working from the moment I press the button "Signin". The App has no problem at the time of…
-
0
votes1
answer30
viewsAdd one vowel at a time to a Textview
I have 5 buttons that emulate vowels, as each button adds one vowel at a time to a display, defined as TextView ?
-
0
votes2
answers121
viewsDoubt about consuming backend with Spring
Good morning, I’m looking to start a Spring project with Ionic my goal is to publish the Ionic app in the Google store and consume the backend with Springboot, I know that has to consume this…
-
0
votes1
answer33
viewsXamarin installation error - JDK does not install
Hello! I have this problem after the completion of the installation of Xamarin. I have tried to download the sdk from the Oracle website, but the installer simply doesn’t start, nothing happens. I…
-
0
votes2
answers479
viewsCompetition and memory sharing between Threads
I have the following code: class Objt { public List<t> list_t1; public List<t> list_t2; public Objt() { // faz inicializações } public void handleLists(List<t> list) { for(t e:…
-
0
votes0
answers190
viewsObject array
I am with a facul work and the teacher asked to divide groups and each look on a subject chosen by him related to java and: What is an array of objects in java?
javaasked 6 years, 5 months ago Adryan Alencar 51 -
0
votes1
answer70
viewsProblem with java logic
Hi, I have a problem and I believe it’s logical, but I can’t find it. I have 4 lists and I have to group the markets of a region, then I have a list with all products linked to the market and I have…
-
0
votes1
answer19
viewsHow in xhtml commandButton identify that an error was generated in Dao and keep the navigation on the same page?
On the xhtml page in a commandButton call the action confirms() to confirm the recording of an object. The return of this method is a string pointing to a new page. <p:commandButton…
-
0
votes1
answer108
views -
0
votes3
answers215
viewsRelationship between two tables
Hello, I would like to know how to create a relationship between two tables, Time and Match, and in the match I should put the columns: time1, scoreboard 1, time2, scoreboard 2, and a date. But my…
-
0
votes0
answers668
viewsorg.hibernate.Exception.Jdbcconnectionexception: Could not open Connection
I am having trouble losing connection to Mysql database, which occurs after few minutes of use. Please, can someone help me? I have no idea what it could be. Follows my codes: Hibernate.cfg.xml…
-
0
votes1
answer303
viewsI cannot save form using spring boot
I’m starting to study spring boot now and trying to do a CRUD, but I’m having a hard time saving my form. No error message appears, neither in the console nor in the browser. I have already reviewed…
-
0
votes1
answer158
viewsJava createNativeQuery Insert datetime
I’m trying to insert into a bank whose dates are datetime2(7). SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); Query u = em.createNativeQuery(insert); u.setParameter(1, sdf…
-
0
votes1
answer42
viewsError when assigning object to another class
In the code it arrow the values of the employees with the first entered value and ignores the others. for(int i=0; i<3; i++) { Empregados f = new Empregados(); System.out.println("Qual é o…
-
0
votes1
answer104
viewsError Arrayindexoutofboundsexception
I’m in that mistake: java.lang.ArrayIndexOutOfBoundsException: 1 at com.ronaldocarvalho.cursomc.resources.utils.URL.decodeIntList(URL.java:27) ~[classes/:na] at…
-
0
votes1
answer323
viewsHow to take a char type die by Joptionpane?
char cadastrar; cadastrar = JOptionPane.showInputDialog("cadastrar: A-aluno P-professor M-medico");
-
0
votes1
answer40
viewsSimple jsf project plus error
This is my screen <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">…
javaasked 8 years, 3 months ago Gleiston Jose de Santana 105 -
0
votes1
answer199
viewsHow to open an Activity from a java class?
I have a java class called Firebase, this class only does functions of firebase... I’m authenticating a new user in firebase, so far so good.. The problem is that I can not pass to another Activity,…
-
0
votes0
answers246
viewsLink Combo Box to Mysql Database - netbeans
I created a database to store employees and departments. in netbeans I created the employee class and department with their respective ID, put a Frame with a combo box to pull all employees…
-
0
votes1
answer302
viewsError 500 (Internal Server Error), when I try to create a session
I am trying to create a session for a login using Java, vRaptor, Hibernate, Angularjs. But when the session will be created I get this exception (500 (Internal Server Error)). This is my session…
-
0
votes1
answer36
viewsUsing java.lang.reflect.Parameter in android applications
Hello. I’m trying to implement an android application (with the Android Studio IDE) that uses Reflections to access certain attributes of a class. However, when using the class…
-
0
votes1
answer395
viewsPerform an action when a button is first clicked and another otherwise
I would like to know how to make an if when the button is clicked. For example: private void btnEditarActionPerformed(java.awt.event.ActionEvent evt) { ProdutosDAO produtoDAO = new ProdutosDAO();…
-
0
votes0
answers351
viewsJPA hibernate - delete children from the list
public class A implements Serializable { @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) @JoinColumn(name = "A_ID") private List<B> bList; } public class B…
-
0
votes1
answer264
viewsCall method in bean if condition is true
I created this confirm: <script type="text/javascript" language="javascript"> function salvarAntes(){ var r=confirm("Deseja confirmar?"); if(r){ return true; } else { return false; } }…
-
0
votes1
answer852
viewsClose a jInternalFrame before Open another
I’m doing a browser project (where I create the "pages" myself in the netbeans design - All offline) just to learn on vacation. However I am with a doubt, I believe it is simple but as I am starting…
-
0
votes1
answer98
viewsAccessing a specific component within a listview
I have a music list with a favorite icon, when the user clicks on this icon I want to change the color of the icon as the like action. In this structure I have an Activity, a listview in this…
-
0
votes0
answers123
viewsHow to generate multiple nested repeat structures with methods
need to generate several nested structures (26) wanted to know how to do this with methods pro code not get too big an example of the structure I need with 4 nested: public static void main(String[]…
-
0
votes0
answers419
viewsE/Recyclerview: On Adapter Attached; Skipping layout on time access the main menu
To produce a shopping mall in my application I made a recyclerview in my main menu to demonstrate all the products that are in the database. I am trying to connect the field known as "Category" to…
-
0
votes1
answer109
viewsNull Object Reference when listing data with Firebaserecycleradapter
I’m trying to popular a Recyclerview with the Firebaserecycleradapter. When the onBindViewHolder method is called to popular the layout through the Viewholder class, the error is triggered:…
-
0
votes1
answer72
viewsTake photo in android application and save in a folder within the project (No drawable for example)
I’m new in android programming and I’m developing a simple project where the user takes a photo of any. Once the photo is taken and the user has confirmed, he wanted to save it in a folder within…
-
0
votes1
answer53
viewschatmulticast in java
I have a small problem in this code below in java. It’s a multicast chat Main error is in the commented constructor. import java.awt.event.KeyEvent; import java.io.IOException; import…
javaasked 6 years, 4 months ago Anastácio Kemerich 1 -
0
votes1
answer189
viewsHow to delete objects within a List?
Guys ,is the following... In this project I’m using JSF,Primefaces and I’m still new to programming.. the list screen is displaying the information according to the bank Only that I wanted to delete…
-
0
votes0
answers17
viewsUsing child class attributes
I have an object from the Account class "Account Lectured" however, using polymorphism daughter classes are assigned to Lectured. public AlterarLimites(Conta conta) { contaSelecionada = conta; type…
-
0
votes2
answers1351
viewsInstant Run works but file . apk does not install
Well, the problem I’m facing is that when I emulate mine app through the Instant Run the app goes perfectly on my smartphone. However, I cannot install the same app through the .apk generated. Use…
-
0
votes1
answer48
viewsSearch for NULL mysql via Java
I intend to save a residence in my database via java when one of the searched parameters is NULL, but it turns out I can’t find a way to pass that command. My code is: public Usuario…
-
0
votes1
answer331
viewsDoubt in database relationship of an application using spring boot
I am developed an application that aims to register a supplier, in which this supplier is Generico (can be a cafeteria, store building material, a pharmacy... etc) in which he will provide products…
-
0
votes1
answer368
viewsCreate a executable from a Java application
I made an application that has a timer to look in a certain directory of 2 in 2 seconds, well when I am running the application in Netbeans it works normally, but I tried to create a JAR of this…
-
0
votes1
answer129
viewsPassing a variable to Annotation
I’m reading a JSON (using Jackson) and wanted to take that value and assign it to Spring-Boot Annotation. Would it be possible ? Follow the example below: @Scheduled(fixedRate = 14400000) public…
-
0
votes1
answer75
viewsActivity Maps restarts every time I minimize
Well, on android 4.2.1 is working, but on another device with android 4.2.2 it restarts, IE, does not save the state of Activity, this problem only appears with the activitys that use map, in other…
-
0
votes1
answer292
viewsWildfly Persistenceunit Missing dependencies
I am trying to make a Web Service using wildfly-10.0.0.Final I am Getting the error Shown Bellow. I already copied/created postgres and eclipselink jars to the Wildfly module folders. 05:13:11,312…
-
0
votes1
answer109
viewsTurn RPG - Character and enemy receive the same attack
I’m developing an RPG in shifts and I’m having problems. The player and the enemy are the same class of instantiated object and they have methods of attacking and receiving damage. However when I…
javaasked 6 years, 4 months ago user103375 -
0
votes0
answers16
viewsJavafxml application with datepicker, insert value in BD
I have to enter the value of a datepicker that comes in DD-MM-YYYY format in the database and when I run the application I get this error: "com.microsoft.sqlserver.jdbc.Sqlserverexception: Operand…
-
0
votes1
answer55
viewsLoop for from index 1 java array
I have a function that makes a loop for in a String array. I need the loop to start from the index[1] of that array. But I’m not getting it. String arquivo[] =…
-
0
votes1
answer51
viewsError with conversion of units
Can someone help me in what is going wrong in this code? public class Conversor { public static String getUnidades(long quantidade) { return getUnidades((float) quantidade); } public static String…
javaasked 6 years, 4 months ago user115863