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
answer142
viewsProblem returning values to a combobox from a query
my DAO public List<Departamento> read(){ List<Departamento> departamentos = new ArrayList(); String query = "SELECT * FROM departamentos"; try { PreparedStatement ps =…
-
0
votes2
answers77
viewsReceive property from a spring form annotated with @Sessionscope
I have a Spring form to login to the system. This login must be kept in session, so I noted the classe Credencial (equivalent to login) with @SessionScope. I receive the data of this credential from…
-
0
votes1
answer51
viewsJava Swing GUI - Messy interface - Field not showing
The email field is superimposed over the name field... and the button is not showing. package javainterfacegrafica; import java.awt.Container; import javax.swing.JButton; import…
javaasked 5 years, 10 months ago user145848 -
0
votes1
answer35
viewsProblem setting a list in a Singleton
well I created a list with a select in the database and wanted to set it on my Singleton so I could use it on all screens: code of my DAO: public List<Requisicao> pegarRequisicoesUser() {…
-
0
votes2
answers4265
viewsError executing . JAR "no main manifest attribute in nutriclinweb-api.jar"
I am using intellij (Spring project), I have taken the right steps to generate . jar, I have tried it in many ways. Follow pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project…
-
0
votes0
answers22
viewshow to create a directory on android system?
I’m using the following code to create a directory when the user presses a button inside a Fragment, but it’s still not working, and I don’t know why. File dir = new File("/novaPasta"); try{…
-
0
votes1
answer146
viewshelp to structure an if with results from a list
i have 11 checkbox’s each have an id equal to the database id and the user can select more than one checkbox how I am using java fx and scenebuilder inicalizei in my controller private CheckBox[]…
javaasked 5 years, 10 months ago Felipe costa 13 -
0
votes1
answer140
viewsTransactions between queue and database
People like you handle transactions between queues and databases ? I have a scenario where I must debit (Withdraw money from account) from a customer account and send a message in the queue, but if…
-
0
votes1
answer228
viewsHow to convert XML with a repeated element to the Java object (JAXB)
I’m having a problem converting an XML file to Java Object. This is my XML file that I receive through Webservice: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"…
-
0
votes1
answer76
viewsHow does a car class in Java convert to C++?
public class Carro { private String nome; private int ano; private String modelo; private String marca; private String combustivel; private Double valor; public String getNome() { return nome; }…
-
0
votes1
answer324
viewsHow to convert Jsonobject to a java class
Greetings to all, I’m developing an app that takes the return of a webservice to be used in this application as login data among others. I would like to ask for your guidance on how best to convert…
-
0
votes0
answers262
viewsHow to convert communication form from Java to Python
Good Afternoon, I have a Java scrip that communicates between the Java application and the MIO Commbox controller. My question is how to convert this Java script to Python, summarizing, need to…
-
0
votes1
answer31
viewsProblem to Insert Data in BD
I created a form that inserted information in Mysql using Nodejs, but it is not inserting anything and not any error in the console and none in the terminal, follows below the code admin.js…
-
0
votes1
answer64
viewsPersonal I would like to know how to exchange data between two JFRAME
Passi 1 = Selected and sent the item table: Which is another Jframe private void jTableProduto2MouseClicked(java.awt.event.MouseEvent evt) { Produto produto = new Produto(); Home home = new Home();…
-
0
votes1
answer110
viewsInput value is the same throughout foreach
I’m trying to build a satisfaction survey where a list of questions appears for the customer to inform the note and by clicking include to save. I managed to ask for a question, but when there is…
-
0
votes1
answer39
viewsReturn a button to its original state after 'download popup'
In my Java Web project there is a button to export a list to a CSV file which, when clicked, displays the message of 'Please stand by' for a few seconds to then return to its original state and…
-
0
votes0
answers57
viewsHow to recover mouse pointer position on android
I have an Accessibility service that captures events touch the screen, and I have a USB mouse connected to the Android device, I would like to know how I can recover the mouse position on the…
-
0
votes1
answer83
views(Java) Error saving multiple lines in a TXT file
I’m trying to record create a log file .txt. I can validate if the file exists using If, but I can’t record outside the if where the file was created. I’m a beginner and believe that the error lies…
javaasked 5 years, 9 months ago Ronison Matos 313 -
0
votes1
answer944
viewsSelenium - Open Chrome with extensions already installed
Guys, I need the Chrome instance opened via Webdriver come with a plugin already installed "Always" that I open. I found some content, but it doesn’t work here. They can tell if it was because of…
java google-chrome selenium selenium-webdriver google-chrome-extensionasked 5 years, 9 months ago Patrick Longo 1 -
0
votes0
answers86
viewsHow to use Classloader.getResources() correctly in Java?
I am unable to capture the right path from where my CSV file is through this line of code below using Classloader.getResources(); @RunWith(MockitoJUnitRunner.class) public class IndicioActionTest {…
-
0
votes1
answer334
viewsIncrease number of Tomcat connections pool
I have a problem in my production server, where my tomcat has locked when a connection is requested from the bank’s connection pool. When I climb the tomcat I see in the log the following message :…
-
0
votes1
answer51
viewsProblems instantiating object in vector by Return of a method - JAVA
I have the following method of the Shop class that has the function of filling the variables of an object of type Sale (besides modifying a product according to the quantity of products sold passed…
-
0
votes2
answers250
viewsRun FOR cycle within another FOR cycle
for(int g=0;g<vl.VerbsList.length;g++){ // primeiro loop ok for(int h=0;h<TextParts.length;h++){ //segundo loop deveria ser executada por inteiro for(int j =0;j<BaseWord.length();j++){ try{…
-
0
votes1
answer66
viewsPrimefaces p:chips, is there any way to start the list of tags with no value?
On my screen, I need the list of tags in the chips component to start empty and when I have values I need them to be set as tags, but when I try to start an empty list of tags, the component starts…
-
0
votes1
answer29
viewsinstance continues running even after being closed by a thread
Good even after closing my instance it keeps running because of a thread I created to call a while: public void nativeKeyPressed(NativeKeyEvent event) { System.out.println("Key Pressed: " +…
-
0
votes0
answers68
viewsError when trying to run "Hello Word" in java, "Editor does not contain a main type"
Guys, I’ve reinstalled, I’ve made step-by-step videos, and I don’t understand why you’re making this mistake in the eclipse. Says the error "Editor does not contains a main type" I put inside the…
-
0
votes1
answer452
viewsProblems transforming file into an array of bytes
Good evening, I’m trying to get a pdf file from a xhtml, and when it comes to saving it in the bank, I want to turn it into an array of bytes, for this, in my DAO I do so: public boolean…
-
0
votes1
answer27
viewsMy Jtable does not update when I add a Row [Solved]
I have a Jtable in my Mainform that receives data from a form in another window only after receiving the data Jtable does not update. private void btnAddActionPerformed(java.awt.event.ActionEvent…
-
0
votes0
answers56
viewsHow to Resolve Unexpected end of JSON input using jQuery
I have a Java API that authenticates a user based on their email and password using JWT. I am trying to consume this API with jQuery. When running the following method, the request falls into error…
-
0
votes1
answer41
viewsLine break in Defaultstyleddocument
I’d like to know why the class DefaultStyledDocument error when inserting a line break, either by \n or by System.lineSeparator(). Minimal example: StyleContext sc = new StyleContext(); final…
javaasked 5 years, 9 months ago Jonathan CR 673 -
0
votes0
answers56
views(Java) Error connecting to SQL Server Local
I am trying to get my project to connect with SQL Server Local, but it is showing the following error: run: Algo deu errado! java.lang.ClassNotFoundException: C:\Program…
-
0
votes1
answer54
viewsProvided id of the Wrong type for class - [JPA] Embeddableid formed by another Embeddable
On the bench I have two tables called Table and Tabub. To Table is composed of a primary key, which is composed of 3 attributes. To Tabub is composed of a primary key, which is composed of 3…
-
0
votes1
answer325
viewsCORS not being applied - Spring Boot
I have a Spring Boot configuration class to handle CORS. This class theoretically allows all origins, all methods and with all headers. @Configuration public class CorsConfiguration implements…
-
0
votes1
answer80
viewsJoptionpane calling the screen Main
Good evening, I believe this doubt is simple but I can not solve, I have a method that displays a message instructing the user in the filling of a Captcha, until then ok, the "problem" is that when…
-
0
votes1
answer75
viewsWhy is it that when I put on the "Jcombobox" component of Swing, my show looks like this?
code I used import javax.swing.*; public class ComboBox extends JFrame{ JComboBox<String> combo = new JComboBox<String>(); public ComboBox(){ add(combo); combo.addItem("Brasil");…
-
0
votes1
answer29
viewsConversion error
I’m trying to update a schedule through Jtable. But when I try to update it gives an error java.sql.Sqldataexception: data Exception: invalid Character value for cast private class BtEditarListener…
-
0
votes1
answer160
viewsFormulario.java:28: error: cannot find Symbol Botaoaction action = new Botaoaction(t);
Ah, so I was creating a show with Swing, heunderlined text reads the name that the user puts, and then shows it to him, very simple thing, I’m still very new, but when I created the class…
-
0
votes1
answer133
viewsRead data from a file and save to a Set, but Set is null
I’m trying to read a txt file, select a specific column called "customerid", take all the values from that column and show on the screen how many different values there are. But when I try to do…
-
0
votes0
answers51
viewsCould not find any META-INF / No Persistence Provider
I have these errors when trying to compile: my Hibernate 5.4.3.Final I created my folder META-INF How can I fix this? INFO: HHH000318: Could not find any META-INF/persistence.xml file in the…
javaasked 5 years, 9 months ago Joao Spirit 101 -
0
votes1
answer287
viewsHow can I change the position of my Jbutton in Swing?
Hello, I’m a beginner and very layman in Java, I was creating a program, and in this program had a button, I wanted to know how I change some button of place in Swing, if someone can help me, I…
-
0
votes1
answer190
viewsDoubt about Hibernate heritage
I have 3 classes / 2 tables: employee / secretary : Functionary salesman employee extends secretariat extends staff i wanted to make a single table inheritance with seller and employee and an…
-
0
votes1
answer64
viewsJprogressbar loading in real time
It sounds silly, but I don’t know why you’re not incrementing the Jprogressbar() of my Java Swing application. Follow code below: public void executar() { JFileChooser fc = new JFileChooser("Z:\");…
-
0
votes1
answer169
viewsHow to sort my Java list alphabetically?
I have a Spring Framework project, and I need to alphabetize my list, and I have no idea how to do it. At first I managed to load the list, but it has to have that order. Please, how should I do?…
-
0
votes2
answers86
viewsProblem inserting data into Sqlite and updating Recyclerview
I’m having problems in my Sqlite bank where I created a method in my DatabaseController.java who is called recuperarUltimoDigitado() - this method retrieves the entered value and then updates the…
-
0
votes1
answer53
viewshow do I use Actionlisten? I need an example to better understand
Guys, in a previous question I had asked a question about actionListen, but I wanted to ask an example, could someone give me an example, I created this simple code q shows a Jbutton in Swing,…
-
0
votes1
answer106
views(JAVA) Error returning record amount using SQL COUNT
I’m trying to return the amount of record of a table, in this table I currently have 6 records but my Query returns only one, as if there were only one record. I need you to return the full amount,…
-
0
votes1
answer40
viewsHow to ensure completion of an angular.js process
I want to ask for help in this process, I have an application in angular.js that I need to issue all the labels of a process, and then all the labels of a second process. The problem is that it is…
-
0
votes0
answers106
viewsProblems with Junit
I’m trying to run some tests on a small application for JAX-RS studies. The following error is shown when I try to run a test case to simulate a GET org.junit.vintage.engine.support.UniqueIdReader…
-
0
votes1
answer240
viewsNo Qualifying bean of type helps with this error:
I’m trying to use the swing and the spring but I have this problem: Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException at…
-
0
votes1
answer343
viewsCalculator doing operations on the result of a previous operation
In my Java class we are learning object orientation, and my prof. asked for a calculator. In this calculator, the user will type the entire expression, for example 10+10, and the algorithm needs to…
javaasked 5 years, 9 months ago user156519 11