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
answer172
viewsValidation Bean Is Not Validating
Hi. I would like to create a program, where I write a task and it would save it in a database. With this I have a class called, which asks for the description to have at least 5 characters package…
-
0
votes2
answers1373
viewsProgram to read 4 values and show in ascending order
Good evening, I started little to hold on programming, I my teacher passed the following question to be made with selection structures If Else in Java: Build a program to read four values and show…
-
0
votes1
answer306
viewsTabs in modal bootstrap
I have a modal in bootstrap and would like to put tabs in this code, however, there is something wrong and the window shown is without the desired shape. Follows the code: <link rel="stylesheet"…
-
0
votes1
answer89
viewsJSF editable datatable shows no object attributes
I need to do an activity with a JSF list where it is possible to add, edit and delete registered users. I had managed to make the records of new people, but when I started using cellEdit to make the…
-
0
votes1
answer146
viewsCould someone explain to me how this new Navegation Drawer works?
I’m starting to study android, and after update 3.5 of android studio the template of Navegation Drawer has changed a lot and as I’m starting to study,someone could explain to me where the Fragment…
-
0
votes2
answers189
viewsDowngrade project version in android studio from 6.0 to 5.0
I developed a project in android studio API 23: Android 6.0 (Marshmallow). However, the project should be developed for android 5.0. I would like to know if there is the possibility of doing some…
-
0
votes1
answer44
viewssimple.Jsonarray for json.Jsonarray
I have a problem. In the same code, I kind of need to use both simple.Jsonarray and json.JSONArray. I can’t import both, so I’m trying to use the simple. It turns out that when I do a request, the…
-
0
votes2
answers171
viewsHow to show values of an Array in a single message?
package Algoritmos; import javax.swing.*; public class testinho { public static void main(String[] args) { int[][] numero_conta = new int[3][3]; numero_conta[0][0] = 111; numero_conta[0][1] = 222;…
-
0
votes2
answers72
viewsUsing Database in Production Postgres - Not Accepted Using Table with Camelcase
Good morning to all. I’m trying to communicate with a Postgress database and so far so good. Inside the bank I have a table called Clientelegado. But every time the application goes up a legacy…
javaasked 5 years, 7 months ago Josemar Sabino 77 -
0
votes1
answer89
viewsswap the text of a label with values of a java array
I’m studying about vectors, and I want to create a program that, by typing a password(only letters) in the text field and pressing a button, the program would exchange the text of the password label…
-
0
votes0
answers67
viewsUsing Proguard with Maven in libs in java swing
I obfuscated my jar using the proguard-Maven-plugin plugin, pom.xml and the configuration are these: <build> <plugins> <plugin> <groupId>com.github.wvengen</groupId>…
-
0
votes1
answer117
viewsIs it possible to make edits in . apk?
I developed an app in java, android studio, and will publish it on a web platform of my own (also developed in java). Only those who have access to this platform are licensed customers and this…
-
0
votes1
answer142
viewsHow to include a new note in an array?
Make a program that calculates the arithmetic mean of N banknotes using array. I’m trying to do this: package exer4; import java.util.Scanner; public class Exer4 { public static void main(String[]…
-
0
votes1
answer33
viewsSpring session attribute is not shown in JSP via JSTL
I have a Credential class that I use to store session user information (it’s annotated with @Sessionscope and @Component). When I print some attribute of this class, it usually appears, but if I try…
-
0
votes0
answers29
viewsPostservice online error with springboot
Hello, I’m doing a CRUD with springboot but I’m having a mistake in only one line, and I would like to know how to solve, because I started studying the tool recently, thank you!! ERROR: Inferred…
-
0
votes1
answer350
viewsError When Putting Application in Production with Command - mvn spring-boot:run
After generating the build which went all right, I am trying to run the command mvn spring-boot:run Inside a folder I’m only with the file comunicacaolegado-0.0.1-SNAPSHOT. jar When executing the…
javaasked 5 years, 7 months ago Josemar Sabino 77 -
0
votes1
answer47
viewsDisplay in a Messagedialog the contents of List<String> message = new Arraylist<String>();
Good night, I need to display the contents of the message array in a Message Dialog: List<String> mensagem = new ArrayList<String>(); In the course of code I add some text to the array…
-
0
votes2
answers267
viewsGet Directory After JAVA Compiled
Beforehand I would like to say that I have already searched in several links indicated here in stackoverflow and other sites as well and I still could not get concrete help (it may be my mistake…
-
0
votes1
answer210
viewsHow to show all values of three matrices in a single message without using indexes
package AlgoritmosII; import javax.swing.*; public class Trabalho1 { public static void main(String[] args){ String[][] A = new String[3][3]; int[][] B = new int[3][3]; double[][] C = new…
-
0
votes1
answer38
viewsHow to display the line number of a method in Java?
Good morning , I am using AST , so I was able to access the methods, attributes and get if it is public or private, among other things. How do I display the line number of a particular attribute or…
-
0
votes0
answers125
viewsHow to print the contents of an Object in a List<>
I am developing a JAVA application in which will display the contents of an object in a list. My goal is to print the object content of a list. package teste1; import java.util.ArrayList; import…
-
0
votes1
answer157
viewsDoubts about the Caelum POO JAVA booklet
Hello, I am studying the Java Object Orientation Caelum booklet and on page 131, I need to import a lib that I took from this link:…
javaasked 5 years, 7 months ago Valdecir Junior 19 -
0
votes1
answer106
viewsHow popular is Jcombobox with an array of strings?
I have a class that inherits from JFrame and has a JComboBox comboBoxPorta = new JComboBox();. I would like to popular this combo with the serial ports. I have a function in another class to print…
-
0
votes1
answer394
viewsError using . stream(). filter in JAVA
I am developing an application in which it aims to create a list that respects the condition of being of type = "unit". In the code below, I create the list and from a function I try to generate…
-
0
votes0
answers16
viewswhen the height is displayed on the screen it stands this way 165.0 and I wanted it displayed this way 1.65
package rpessoa; import java.util.Scanner; public class Pessoa { private string name; int private dia; int private mes; int year; private double height; private int age; // Construtor /*public…
-
0
votes0
answers44
viewsSending JSON to web-service via Http
I have a question that I believe to be simple to solve, I have a web service that feeds my App, I can request this information but I can’t send information, the closest I have so far was: JSONObject…
-
0
votes2
answers226
viewsHow to compare instances of Localtime?
How do I compare two variables of LocalTime in Java? I can’t use the patterns. import java.time.DayOfWeek; import java.time.LocalTime; public abstract class CorrespondenteBancario { private…
-
0
votes1
answer23
viewsRetrieve a Jcombo content in another class
I need to capture the content of this Jcombo that will have door (com1, com2. etc) for in the other class print set port for printing. I’m not getting. public class Form1 extends javax.swing.JFrame…
javaasked 5 years, 7 months ago Gilcecler Carneiro 49 -
0
votes0
answers54
viewsID by variable it returns null and if you put the ID "in hand" it returns the right object
I am trying to recover a code received by a request to recover objects from the database, but am encountering some problems. Performing tests, replace the id coming from the request, by a forced…
-
0
votes1
answer21
viewsReceive Email with Android Java
I have this simple screen <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"…
-
0
votes1
answer454
viewsNetbeans does not generate lib folder
Hello, well I’m having a problem compiling a project with Netbeans 11 and jdk 13 for some strange reason when compiling the folder dist will only the jar and the folder lib is not compiled together.…
-
0
votes1
answer117
viewsHow to make a Try catch with mathematical operators?
I’m doing an activity that consists of a simple calculator, but accepts operations with multiple operators (example: 1+2+3-4 = 2). I have already made a Try catch to handle the error if the user…
-
0
votes2
answers127
viewsUpdate variable values on repeat loop
I ran a simple cash-and-deposit operation code on a variable. The code works and meets withdrawal and deposit operations normally, it happens that when I want to do a new operation, the value that…
-
0
votes1
answer57
viewsTrunc Hibernate
I have the following query that I need to search in the database for schedules according to the dates reported (initial date and final date). Let’s say I made an appointment for the 20th/10th/19th.…
-
0
votes1
answer29
viewsAndroid Studios, how do I not repeat questions?
public class Quizmelhor extends Activity { private question aquestion = new question(); private String resposta; private int scores = 0; private int questionlength =…
-
0
votes1
answer150
viewsIgnore the header when inserting data from a csv file into a Java string array
Good night, I read a csv file and stored the information in a string array. The file from position 0 to 8 has string content, from position 9 to 29 has in its entire content. I need to compare if…
-
0
votes1
answer68
viewsHow to close one Jinternalframe when opening another?
Hi guys I’m developing a project for my course, and when I click on the menu to open a new JInternalFrame, the same opens "below" of the other already opened. I would like to know how to open it "on…
-
0
votes1
answer269
viewsBindingresult is not working properly with Validation
My goal is to register an older person with a valid name, through validation. The class Person.java: package br.com.Test.domain; import javax.validation.constraints.Max; import…
-
0
votes1
answer68
viewsHibernate Query using Like and Where
Beauty guys ? So I’m doing a query with Hibernate, which is the following: Query query = session.createQuery("SELECT c FROM Cliente c WHERE c.filial =:filial AND c.ativo =:ativo AND c.tipoCliente…
-
0
votes1
answer81
viewsstopService() not for service
I’m studying Services on Android, I can perform the same in a simple test just for understanding, but I can’t stop it in main Activity at all. I believe I’ve tried everything. I tried to put…
-
0
votes3
answers339
viewsSpring Boot does not recognize the controller when a request with parameters is sent
Spring Boot does not recognize my controller if I submit more parameters in the request. For example: If I send a normal GET request spring boot recognizes my controller:…
-
0
votes3
answers99
viewsReturn method asks return that has already been given
I have the following class: public class Exemplar { private boolean disponivel; private int codigo; // seus setters e getters } and this other: public class Biblioteca { private…
-
0
votes0
answers31
viewsImage is recorded in the folder I created and another in the camera gallery
I have the following problem I have an app, which takes photo however and Torola device is recording in the gallery in addition to record in the folder I said it would. Intent photo = new…
-
0
votes1
answer69
viewsJpanel does not appear in Jdialog
I’m solving an activity with the following statement: Create an application to display eight Jpanel components in a Jdialog window. Each panel should be colored with one of the eight colors of Table…
-
0
votes2
answers186
viewsError starting Applicationcontext through a Spring application
Good colleagues. I’m starting to develop with spring, but I’m having a problem not being able to run my web application, whenever I run launches the following error message in spring: Error starting…
-
0
votes1
answer470
viewsQuicksort in double chained list
For a college task, I need to adapt the quicksort algorithm to a "time" object, which contains dozens of attributes such as stadium, name, nickname, date of foundation, etcs. Within main, a list of…
-
0
votes1
answer88
viewscapture duplicity error in mysql with java
I’m trying to show a message that there is already a registered id, but it falls in the catch that shows: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry…
-
0
votes2
answers1000
viewsFill in a matrix and add up your numbers
I need to make a program (MATRIX) that performs the sum of all elements of a 10x10 matrix, containing integers. But I’m not able to add or put values in all elements of the matrix. As I do not use…
-
0
votes0
answers124
viewsHow to use cookies to authenticate in an API?
I have a problem to authenticate in an API, it generates a cookie after logging in with user and password, soon after, to perform a GET I need to send the generated cookie. Explaining in detail: To…
-
0
votes1
answer19
viewsHow to take value from a Radiobuton to save in a Class
I need to make a screen where the client has several options of radio Buttons to select, then I have to take these values and set in a class that has the field valor. private String nota; /*quero…
javaasked 5 years, 6 months ago Gabriel Assis 1