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
answer609
viewsSyntax Error! Java + XML
The database should be implemented in the Sqlite and should have the tables; tbprevisao and tbcidade The system should keep the data of the cities already consulted in tbcidade to avoid having to…
-
-1
votes1
answer54
viewsjavac is configured and does not compile . class
javac is configured but does not compile to . class…
javaasked 7 years, 5 months ago Alexandre Dias 1 -
-1
votes1
answer55
viewsAdd values in a 3-dimensional matrix
How do I get the user to add values to an array [][][]? calendarioEventos = new Evento[dia][mes][hora]; for(int i = 0; i < calendarioEventos.length; i++) { for(int j = 0; j <…
-
-1
votes1
answer72
viewsTake text from a website span and return to the console
How can I take a website span and return the text on the console? I tried this way, but I don’t know how to get Span: public void SpanSite(){ URL url = new URL("https://google.com"); BufferedReader…
javaasked 7 years, 5 months ago user92401 -
-1
votes2
answers718
viewsClear() and Sendkeys() in a single method
I have the methods clear and sendKeys and wanted to "colapsar" both in one, WebElement user = webdriver.findElement(By.id("username")); user.clear(); user.sendKeys(username); WebElement passw =…
-
-1
votes1
answer257
viewsError: Unexpected type required
This code should invert a string given by the first argument, but has a build error public class ex4 { public static void main (String args[]) throws IOException { int strlength=length(args);…
-
-1
votes1
answer257
viewsUnhandled Event loop Exception
I went to upgrade my eclipse and I’m using the Oxygen version. When I start or when I will check if there are package updates this message appears below and my tollbar does not appear. does anyone…
-
-1
votes1
answer372
viewsConfiguration EAR+Hibernate 5.2+Maven+JTA+Mysql project
Hi, I built a Maven j2ee-EAR project, but I’m having trouble setting up Hibernate/JPA. I added the dependencies in pom.xml, as below: <dependencies> <!--…
-
-1
votes1
answer1825
viewsI cannot import a project into Netbeans
I cannot import a zip project into Netbeans. What is happening and when I go to >File>Import Zip project is I select the File and click on import it happens this Or at the time of importing it…
-
-1
votes2
answers417
viewsMove android studio to another computer without installing
To vacation in a small town, here the internet is very slow, I want to move the android studio to a more advanced computer I bought, only I can not via internet, I wonder if it is possible to pass…
-
-1
votes1
answer110
viewsHow to add to Abstracttablemodel a combobox populated by database information?
I would like to know if it is possible to implement a combobox in a AbstractTableModel so that it receives information directly from the database for filling. if possible someone could give me an…
-
-1
votes3
answers950
viewssystem.out.println(""); syntax error
I started learning Java with the Ellipse and I’m learning more and more every day. But I came across a situation: when I use the system.out.println(""); , Eclipse "says" there is a syntax error and…
javaasked 8 years, 11 months ago Brenner Passos 13 -
-1
votes2
answers3282
viewsRead . txt files and put them in an Arraylist
How to read the file . txt below and turn it into an Arraylist? Alicate;6;3.4 Martelo;10;4.5 The Arraylist at the end would look like this: [[Pliers, 6, 3.4],[Hammer,10;4.5],...] try{ FileReader fr…
javaasked 7 years, 3 months ago Kenneth Anderson 313 -
-1
votes2
answers878
viewshow to press the button using code, using the same effect as when the user presses
I’m making the game for java and when starting the machine will give a random sequence of clicks on 4 buttons and then the user has to press the same machine, but I do not know how to make the…
-
-1
votes1
answer276
viewsMigrate Tomcat server to Wildfly in eclipse
I am trying to migrate a project (Java, Hibernate, JSF, Springsecurity, CDI, Mysql) that currently runs on TOMCAT to WILDFLY. I have already set up "standalone" with the connection and Wildfly alone…
-
-1
votes1
answer89
viewsPrevent object from replacing others in Arraylist
I have two loops that have the function of replacing texts with other values. The problem starts when I have an object added to a ArrayList, in the case the object clone. The addition is in the…
-
-1
votes2
answers906
viewsPrinting java Boolean attributes
Good morning! I’m starting now in java and I have the following question: "Why doesn’t the Boolean Tuition attribute appear for me to display the reported result?" Follow below the image of the…
-
-1
votes1
answer26
viewsReturn a value from a two-variable calculation to show the user using POO. Result is not printed on screen
Scanner deltas = new Scanner(System.in); Double ds; System.out.println("Insira o valor de Delta S"); ds = deltas.nextDouble(); setDeltas(ds); Scanner deltat = new Scanner(System.in); Double dt;…
-
-1
votes1
answer4841
viewsHow to validate a text (Assert) in a given field in Selenium Webdriver?
How do I validate a text in a given field? The location is xpath: html/body/div[1]/div/div[4]/article/div[1]/div/header/div[1]/h1 The text is "Congratulations! Successfully inserted". How should I…
-
-1
votes2
answers2073
viewsWhile inside While (While principal stops)
I need to create two bonds going from 1 to 10, only one inside another. WORKS Using for and for. Using while e for. Why doesn’t it work? 1) WHILE AND WHILE int a=1, b=1; while(a<=10) {…
-
-1
votes1
answer1329
viewsHow to order an Arraylist in ascending order by date
I need to order a ArrayList in ascending order by date. For I keep adding values out of order in it. In my ArrayList has only two fields in each element: data and valor. Does anyone know any method…
javaasked 7 years, 1 month ago Diego Soares 403 -
-1
votes1
answer416
viewsJOIN 3 tables +1 JDBC junction table
I have a program in java that returns the list of users who have an appointment that day, for this I built a database that related some important data of the users, the name of the doctor with whom…
-
-1
votes4
answers81
viewsSuccinct conditional structure with multiple comparisons
How to compare three items with the same result? I’m currently doing it as follows, only this way the code design doesn’t look stylish. if ($title == 0 && $squad == 0 && $level == 0)…
-
-1
votes1
answer181
viewsJPA Eclipselink - No entity update
I have a relationship in the JPA of Client 1 -> 0.. * Loans. So I have in the client class a set Loan List to make the Onetomany. It turns out that when I add a customer he updates the normal…
-
-1
votes1
answer281
viewsProblems with Glassfish Permgen Space
I have a project that runs a web control system, it has a web service Rest for mobile queries and data collection. It performs perfectly, but the project is still under development. It has already…
-
-1
votes1
answer605
viewsHow to find the largest element of a vector recursively?
I could only do it iteratively, but recursively I have no idea how to start.
-
-1
votes1
answer172
viewsAndroid Studio Doesn’t Recognize Gradle Libraries
I took a project that has several external dependencies, like facebook lib, even some of the android support itself. The design compiles normally and runs perfectly on the device. The problem is…
-
-1
votes1
answer556
viewsHow to save a record in Postgresql?
This error occurs when I try to save a record in the Postgresql database, I am using java mai 15, 2018 11:09:18 AM bibliotecapesca.CadastroLeitor BtnSalvarActionPerformed GRAVE: null…
-
-1
votes1
answer279
viewsSimulate the operation of a processor using java swing
I need to simulate the workings of a processor using queue concepts. This processor will be color, where the user adds the color they want to be processed and its run time, this color needs to enter…
-
-1
votes1
answer268
viewsProblem listing data in JSP
I cannot do Data Listing. You are giving "Error Processing request", Servlet Path:/pages/data.jsp Path Info:null Query String:null... I don’t know what it is. Thank you for any help. OBS.: I’m…
-
-1
votes2
answers668
viewsAsynchronous Call to a Restfull Webservice
I need to make a call to Webservice on Android, and with another class call it. At the end show on design the answer obtained by Ws. I already made the Webservice only that the part of…
-
-1
votes1
answer583
viewsHow to update to table with Foreign key
I have table discipline and table teacher. The teacher contains discipline. How do I change the name of the discipline and automatically change in the teachers? I’m a little confused about using On…
-
-1
votes1
answer118
viewsHelp with Java Pointer Error
I’m doing a Bank Queue project with priority, I did everything the way I learned, but this giving some null pointer error that I’m not able to understand, could someone please help me understand…
-
-1
votes1
answer54
viewsJava service that queries Sqlite once a day
I am new to Android programming, I would like to know which java service I use to consult the base Sqlite once a day, I want even if you turn off the device or restart, the service is activated…
-
-1
votes1
answer35
viewsWeb Application (running only on mobile)
Is there any way I can basically make an installer, as if it were an app or mobile game???? Because I wanted to generate an access icon for the customer without having to open site through browser.…
-
-1
votes2
answers65
viewsBest way to receive "keyboard" date
Good morning, Galerinha. I need to know how best to store java dates. Example: In a customer class I need to receive the customer dataDNascization, but for that I need to receive this date from the…
javaasked 6 years, 10 months ago Raphael Davisson 9 -
-1
votes1
answer2560
viewsWhat API to use for Java Desktop applications
I am looking to develop a Java Desktop project and would like to analyze what would be the best API for it. I’m in need of something like the state of the art of desktop Apis for Java. I did a…
-
-1
votes2
answers238
viewsWhy is this algorithm in Java not running?
import java.util.Scanner; public class CalculoSalarioLiquido { public static void main (String args []) { System.out.println("Programa para calcular o Salário Líquido: ");…
-
-1
votes1
answer99
viewsHow to make a PDF file in my APP’s Assets open by the android’s native PDF reader?
I have an APP that needs to open some PDF files (laws) that should come along with the application. The idea is to call an Intent to open these PDF files by Android’s own native PDF reader or a PDF…
-
-1
votes1
answer193
viewsError reading a long number in java
I am reading a vector in java and make the sum of all the elements but this saying that are incompatible type, how to solve My code package capitulo2; import java.util.Scanner; public class…
javaasked 6 years, 10 months ago rafael marques 939 -
-1
votes2
answers57
viewsHow to use the same Drawer Navigation menu on multiple Activitys without repeating code?
How to use the same menu Drawer Navigation in several activitys without repeating code?
-
-1
votes1
answer63
viewsJAX WS RS JPA does not return Onetomany relation in JSON
In my relationship, a Call is related to many Histories. The key to the Call is present in each History. When consulting a History by code, there is a @Manytoone relation that returns the Call to…
-
-1
votes1
answer791
viewsHow to check if the field is filled in
I have some Edittext that must be filled. The button that checks if it is filled is an imagebutton in actionbar. I tried to do it in a way but it didn’t work. the mistake is…
-
-1
votes1
answer59
viewsRead only a portion of a. txt file in Java
Hi, I’m developing a Discord bot and wanted it to get the Guild ID and Chat I made it write automatically when someone typed -setarbot Guild: 430119147146444807 Channel: 437245715576520716 in a file…
-
-1
votes1
answer399
viewsDoubt about the eclipse [Workspaces Master]
Hello, I would like to know why my eclipse treats a project like [Workspaces Master] And why classes get a question mark. (This project was imported).…
-
-1
votes1
answer233
viewsHow is Java related to Mysql?
I want to develop an expense control software and I want to use Javaswing with Mysql. So I have a question about the database. I know it stays on a server, but when I compile the program and want to…
-
-1
votes2
answers790
viewsNull return for List<String> method
I have a method with return type List<String>, when a query is made I can return a value or nothing: public class Repositorio { @PersistenceContext private EntityManager em; public…
-
-1
votes1
answer283
viewsAn error occurred while performing resource injection on the state managed bean
When I try to run java, this error occurs. I’ll send the code. MODEL: package com.pi.drogaria.model; import javax.persistence.Column; import javax.persistence.Entity; @SuppressWarnings("serial")…
-
-1
votes1
answer64
viewsPrint class list attribute in xml
How can I generate an xml file in java, from a class that receives an Arraylist as attribute. I am not able to access the indexes of this Arraylist at the time of passing to the string that will be…
-
-1
votes1
answer881
viewsSet auto-increment in Dbeaver
After creating the column idpagamentoCielo as a primary key, I could not add property auto-increment to the column. How can I assign the property auto-increment to the column idpagamentoCielo? Note:…