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
answer299
viewsPrevent database insertion with String " (with space in name)
My problem is this:: I have a Jtextfield that will receive the name of my entity, will pass to the controller, which will create the bean and finally, call the DAO to insert into the bank. Simple…
-
-1
votes3
answers63
viewsJava Doubts - Creating Classes(Objects)
a question of beginner.. If I create a Minhacalculator Object(Class), the default value of that object will be 0 or null? Taking into account that I have declared only variables of the whole type in…
-
-1
votes2
answers58
viewsHow to use Vectors for Instacing in JAVA?
Hello, I’m doing a game of questions and answers in java and I’m having problems with the instacing of Multiplus players(Object). I wonder how it is possible to use vectors to create Multiplus…
-
-1
votes1
answer40
viewsEdittext via Java
Hello, I am developing a custom view and would like to know how it would be possible to add an Edittext via Java (without using xml, and without referencing the R class because it would be via java…
-
-1
votes3
answers20
viewsHow to delete all files from a directory using Fileutils.cleanDirectory();
I am trying to delete all files from within a folder, but not delete the folder itself, I have been recommended to use Fileutils.cleanDirectory(), however, I cannot specify the folder I want it to…
javaasked 6 years ago Caio Silveira 1 -
-1
votes1
answer1941
viewsInsert with integrity restriction
I have two tables: Table person: CREATE TABLE T_AM_OME_PESSOA ( cd_pessoa NUMBER (8) NOT NULL , nm_pessoa VARCHAR2 (60) NOT NULL ) ; ALTER TABLE T_AM_OME_PESSOA ADD CONSTRAINT PK_AM_PESSOA PRIMARY…
-
-1
votes1
answer53
viewsHow can I display a string provided with an arraylist in a combobox?
Good morning. I have a record of films, which are found in an arraylist. These films have a name, director etc. Since this array is public, I would like to display, in another interface, the name of…
-
-1
votes2
answers33
viewsHow do I list a searched user in the database with a Jtable?
DAO class package DAO; import java.sql.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import javax.swing.JOptionPane; @SuppressWarnings("unused") public…
javaasked 5 years, 11 months ago alejacques 3 -
-1
votes1
answer180
viewsWhat is the difference between the ending, Finally and finish in Java?
What is the difference between the terms: final, finally and finalize(), in the programming language Java?
-
-1
votes1
answer1163
viewsSending XML to webservice
I need to know how to send XML to a client’s webservice. Since I’m very new to this, I did a little research on some sources and found a very simple code for java. I wanted to know if everything is…
-
-1
votes1
answer756
viewsjava.net.Socketexception: Connection reset
I have a web service that validates the users of the application that runs on Android. In positive case the system returns a JSON with the information that is ok and to which database that user has…
-
-1
votes1
answer55
viewsAccess to variables in another class
I have to do a project for the college and in it I have a menu of settings, which is in a class separate from the main one, but when I try to "save" such settings the main class does not see the…
javaasked 8 years, 7 months ago Leonardo Fornaro 29 -
-1
votes1
answer28
viewsJDBC mysql Macos operating system
hello No more JDBC Mysql connector for macos ? I searched the Mysql site and could not find. thank you
javaasked 5 years, 11 months ago Marcos Aurelio Binoti 17 -
-1
votes2
answers27
viewsI have a variable set by parameter. How do I use it on buttons (Action Performed)?
I received this variable (per parameter) from another Jframe: public App(int id) { System.out.println("teste: "+id); /* codigo aqui... */ } and wanted to use inside that 'action performed button':…
-
-1
votes1
answer115
viewsHow to create a parameterized Java method?
This is a Java method that is very coupled, and I need to decouple this method because there is a lot of code inside it, the block of code that I need to get inside the method uploadfile() is marked…
-
-1
votes1
answer139
viewsJava: Problem with Substring
I created a program to translate musical notes from a site to a more readable format, it receives and analyzes every two digits of a string looking for them (as key) within a hashmap, if found, the…
-
-1
votes1
answer279
viewsjava:7: error: invalid method declaration; Return type required
Name of the complete error: Cliente.java:7: error: invalid method declaration; return type required public cliente() { ^ Code I used: import java.net.Socket; public class Cliente extends…
-
-1
votes1
answer592
viewsGenerate a PDF page using Java on the back and angular on the front
I would like the help of someone, I am developing a system using Java with Spring Boot framework, and Angular on the front, and I would like to generate a PDF with a predefined template, just…
-
-1
votes1
answer1024
viewsjava.lang.Runtimeexception: Unable to start Activity Componentinfo {...}: java.lang.Nullpointerexception
I’m trying to rewind facebook data and I’m getting this error. Logcat 10-24 00:46:41.230 7526-7526/sptour.hotmail.com E/AndroidRuntime: FATAL EXCEPTION: main Process: sptour.hotmail.com, PID: 7526…
-
-1
votes1
answer49
viewsString Break for Array
I’m getting a comeback from a string from the REST API as follows: string bancos = ["BRADESCO", "ITAU", "SANTANDER"]; Only I want to make this string an array for me to iterate with the returns. How…
-
-1
votes1
answer192
viewsPython Convert XLS (2003) to XLSX
Good Morning! Guys, I have a directory with several spreadsheets exported from my system in XLS format (Excel format 97 - 2003), I need to write a script to go through this directory and convert…
-
-1
votes1
answer81
viewsRead objects through the Scanner class
[![PHOTO OF THE CODE][1]][1] I am not able to instantiate an object and read it with the method of the Scanner class. It is possible to do something like? Scanner s = new Scanner (System.in); Notas…
-
-1
votes1
answer39
viewsIs it possible to count license validation days without depending on the system date?
I’m new to the programming world. With the help of some tutorials, I was able to build an application for school management. Also with the help of the Javaplugados channel I was able to build a…
-
-1
votes1
answer40
viewsView Datatable only if there is registration
I have several datatables in a panel, each one displays a value of an object and a button, and as the data is received, some are filled and others are not, the problem is that those who have no…
-
-1
votes1
answer62
viewsI have an error in Netbeans I can’t make lambda expression
I’ve already changed JAVA_HOME: to C: Program Files Java jdk-11.0.4 but still I’m still having an error with Netbeans IDE 8.0.2 and 11.0 but the error persists. That was the mistake: lambda…
-
-1
votes1
answer57
viewsThe program is not finding the main (main) method of the setup class
Good afternoon, I’m having trouble running my program in Java, when I compile there is no problem, but when I try to run, says that can not find the main(String[]), (class and file have the same…
javaasked 5 years, 8 months ago João Gonçalo Pomar 1 -
-1
votes1
answer528
viewsError: Could not find or load main class in module Program_reading
I am with this error the hour I try to run my application, someone knows help me ?…
-
-1
votes1
answer33
viewsConvert timefield type of Ext JS to time in DB
I have the following code: var finalTime = record.get('attendance_time'); //Recupera valor do attendance_time record.set('attendance_time',finalTime.toTimeString()); In this code I take the value of…
-
-1
votes1
answer310
viewsBUG - New JAVAFX Project in NETBEANS 11
I’m trying to create a new project with JAVAFX in the NETBEANS 11.1 with the UBUNTU 18.04. I tried several ways to configure, reinstalled JDK, switched between JDK 13 and Openjdk, installed openjfx,…
-
-1
votes1
answer36
viewsCommand "find" eclipse
Whenever I open a window, every editor is "overshadowed" making it difficult to read, someone has already gone through it and can help me?…
-
-1
votes1
answer256
viewsTake data from a dynamic table to write to the database
Good night, you guys. I’m having a hard time how to get the data from a dynamic table and record this information in the database. The idea is this, it’s a system for controlling drivers' working…
-
-1
votes1
answer34
viewsI cannot compile program in Java
I tried to download the JDK 8 x86 bits change the Pach and nothing the code keeps giving the error... The Selection cannot be lauched, and there are no recents launches…
-
-1
votes1
answer183
viewsSet column order in database using Springdata
I would like to know if it is possible (if it is, how to do) to define the order of the columns in the banco de dados using JPA. I noticed that it creates the column Id first, and then the columns…
-
-1
votes1
answer84
viewsJoin with criteria
I have the following entities: public class Mapa { //many to one private ItemMapa itemMapa; } public class ItemMapa { //many to one private Classe classe; } public class Classe { private Long id; }…
-
-1
votes1
answer253
viewsDoes Oracle’s JDK 13 have Javafx?
I saw that now Oracle has a JDK13, I have to wonder if it comes with a Javafx, as in JDK8 came with the Javafx8, thank you.
-
-1
votes2
answers322
viewsDate problem in spring boot + mysql
Good afternoon, I’m trying to make a findAll on spring boot because the date is coming with 1 day late. public List<ContaReceber> findAll() { return contaReceberRepository.findAll(); }…
-
-1
votes1
answer239
viewsFunction that reverses the values of the vector into another vector
I have the following code: import java.util.Scanner; public class ativ15 { public static void main (String[] args) { Scanner sc = new Scanner (System.in); int i; int A[] = new int [10]; int B[] =…
-
-1
votes1
answer161
viewsEvent change with ajax
I need a field, when a value x is set, to render two other fields. With my current method, I can only render a single field. How do I select one? <h:selectOneMenu id="regional"…
-
-1
votes1
answer33
viewsAdd more than one identical key to a table
A problem arose in an excerpt of the code, where it is stored in a variable Hashmap 2 different values, the problem is that the indexing as I understand it is done by the key, that is, it is not…
-
-1
votes2
answers69
viewsjavax.net.ssl.Sslhandshakeexception only on Glassfis 4
I made a routine for online payments in Cielo, JSF , the tests I did with Tomcat 9, with Windows 10 ran 100%, but when I put in production in Glassfish 4, the system when redirecting to the Cielo…
-
-1
votes2
answers4461
viewsHow to limit the number of decimals in Java
Hello, in this section I take a double multiplic value to 0.3 and display in a textview, as I show the result with 2 decimal places? deslocamento.setOnClickListener( new View.OnClickListener() {…
javaasked 5 years, 5 months ago monza reis 1 -
-1
votes1
answer37
viewsUsing Map<K,V> to access Object
I have a Key value object, where the value is an Object Map<String, String> endereco = new Map<String, Object>(); endereco.put("logradouro", "Rua Um"); Map<String, Object> aluno =…
javaasked 5 years, 5 months ago Daniel Gomes 33 -
-1
votes1
answer29
viewsI lost files with extension . java
Good day lost all files with java extension just got files with extension . class will these files . class has some utility or have restart my project..?
javaasked 5 years, 4 months ago octavio cossa 15 -
-1
votes1
answer398
viewsSpring Boot error with time zone
Hello, when I run the program spring gives this error: java.sql.Sqlexception: No Timezone Mapping entry for 'Timezone'. My question is how I put useTimezone=true&serverTimezone=UTC in my…
-
-1
votes1
answer39
views"Non-static method" error
Below is my part of the code that is giving this problem: "Non-static method' write(byte[], int,int)' cannot be refenced from a Static context". I don’t understand this error message! Could you help…
-
-1
votes1
answer418
viewsPrint prime values contained in an array
I can’t get the prime numbers that are inside this List4 array; I’ve tried several ways, but without success. Currently, my code looks like this: List<Integer> list8 = new ArrayList<>();…
-
-1
votes1
answer44
viewsCheckbox selection
Good night, In my app, I need to select a total of 2 Checkbox boxes. After selecting 2 boxes, all others should be set with setEnabled(false). So far so good, but how will I know which box was…
-
-1
votes1
answer298
viewsDoubt about toString Java method
I would like to know the difference between using and not using the method toString in Java, because I understood that it serves as a print normal. Has some advantage in using this method ? My…
-
-1
votes1
answer27
viewsError after using Flyway in project
As I said on this topic Project flyway and jpa-Ibernate getting confused, includes in our project the Flyway, After correctly running Flyway and the project create the tables, insert, change and…
-
-1
votes2
answers1997
viewsReplace all letters of a String with asterisks
I’m not able to replace all the letters of the word with an asterisk, only a few are being replaced. How do I get them all replaced? Scanner sc = new Scanner(System.in); String conversor = null;…
javaasked 5 years, 3 months ago Fabio Rodrigues 3