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
-
-3
votes1
answer159
viewsHow to perform sales commission calculation
To summarize well what I want, I will do so so that the program should run: Digite o nome do vendedor: Joao Digite a meta do vendedor: 1000 Digite o valor de vendas: 499 After this I need to make…
-
-3
votes1
answer61
viewsI need to create an Arraylist in Java
I need to create a program that works like a library. I managed to create a part of the program that creates a book, given the information as parameters. Now I need to create an Arraylist that can…
-
-3
votes2
answers166
viewsDoubt with "Return" in functions (java)
I have a basic question with the following code: public static float calcularMediaAlturaHomens (float TotalAlturaHomens, int NumeroHomens) { if (NumeroHomens == 0) { return "Sem média!"; } return…
javaasked 4 years, 6 months ago Davi Ribeiro 27 -
-3
votes1
answer103
viewsAccessing List of another class
I have a Warehousing class that contains a list of products, as would the interaction of this list in the managed class using the returned methodProduct() without parameters. On the output of my…
-
-3
votes2
answers192
viewsHow to make the findById method in spring-boot?
I’m making an Api where I need to get a user’s information through findById, but the STATUS in Postman is like 200 and did not display anything. Code below. controller @RestController…
-
-3
votes1
answer59
viewsHow to use String to quit while repetition?
Hello I made a code to calculate the grade points. The way I did below it works normally, but I want to quit the repetition While by typing "exit". What I have to change in the code? I calculate…
javaasked 4 years, 3 months ago Plinio Pereira 55 -
-3
votes1
answer45
viewsStop loop with typed text
Hello, I’m new to programming and would like to know if I can stop this loop when the user type "Quit" in the dialog box "Enter your name". public class PeriodoDeVacinacao { public static void…
-
-3
votes1
answer51
viewsJava class with float and int
I am developing an MVC project with Java for web using eclipse. In the table database product is like this create table Produto ( Idproduto int identity primary key, Nome varchar(40), Preco…
-
-3
votes1
answer24
views<table> does not display the data I am passing
public List<Paises> getAllAmericaSul() { List<Paises> listaAmericaSul = new ArrayList<Paises>(); try { Statement stmt = connection.createStatement(); ResultSet rs =…
javaasked 4 years, 1 month ago Pedro Vinicius Santos Rodrigue 1 -
-3
votes1
answer21
viewsUpload image profile photo and associate to "profilePhoto" attribute in User entity with Spring
Guys I have an entity that way: I am using Spring Boot and Postman to instantiate new User class objects @EqualsAndHashCode(onlyExplicitlyIncluded = true) @Entity @Table(name = "tb_users") public…
-
-3
votes2
answers37
viewsBug with Bean and @Autowired using Spring
I’m doing a program for costume rental stores and I’m using Spring Boot.My mistakes are in the controller and dao. Follow the necessary controller code: @Controller public class AluguelController…
-
-3
votes1
answer28
viewsSocket is closed
I’m trying to create a very simple application, make only a TCP/IP connection using Java Socket, record the client message in a file and return the response to the client, but the last part, which…
-
-3
votes2
answers36
viewsExercise with ongoing scanner, does not perform correctly
I’m studying in a game development course using Java, in one of the classes is proposed an exercise using scanner,but when trying to execute the code does not execute correctly. the code in question…
-
-3
votes0
answers18
viewsSearching for Javascript session cookie does not work what to do?
I link the site, and when I look at the cookies, there appears the cookie from another domain (which is a specific tag that is on the site) so I need to create an if that locates if this cookie…
-
-3
votes0
answers33
viewsTry Catch in infinite looping
Whoa, guys, blz? First time here and I’m starting to learn Java as my first programming language. Okay, my teacher sent me a challenge to make a simple program that asks the user for an…
-
-3
votes0
answers16
viewsArray check
I need help to check if the product of the code entered is registered in an array, if it is, the data will be displayed and will be requested to read the amount of input of the same product. case 2:…
-
-3
votes0
answers21
viewsTimezonedump class prioritized in the runlist . Is it an ECLIPSE IDE bug?
When executing the class testaListagem in the ellipse Version: 2021-06 (4.20.0). Although there are no syntax or logic errors and follow the correct procedures, drivers etc. The following error was…
-
-3
votes1
answer26
viewsHow to create video player activity
I am currently using the Kotlin programming language in the application but if someone has some documentation or example code in java has no problem regarding the question below I would like to…
-
-3
votes0
answers28
viewsWhere is the error in this numerical method?
I’m hours away from finding my mistake in this Jacobi method, I’ve checked with friends, and I can’t find where that mistake could be. The expected outputs are approximately: 0.78, -1.96 , 1.03.…
-
-4
votes3
answers581
viewsError: Sorry the Aplication.... has unexpectedly stopped Please Try Again Java Eclipse
I’m having a problem with my project and I don’t know how to fix it. I’m trying to create a calculator using some internet tutorials but, is giving this error when I try to run in emulator: Sorry…
-
-4
votes2
answers5634
viewsHow do I call another screen in java, I’m not getting
Follows code of the Telaprincipal class package telas; import java.awt.BorderLayout; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import…
javaasked 11 years ago David_Ferreira 1 -
-4
votes1
answer763
viewsCannot create a Session after the Response has been Committed
I have the following error in my application that occurs when I access any page. I had to redo the layout of the application and that’s when the problems started. Whenever I accessed a page, except…
-
-4
votes2
answers367
viewsHow do I use a CSS from the site url?
I wonder if there’s a way I can use a different CSS for a "Java" web system without having to include it in the source code? I have a new CSS file that I resized the buttons and spaces and I need to…
-
-4
votes1
answer80
viewsAbout JAVA and Heidisql
People I’m starting programming in java,.
-
-4
votes1
answer1528
viewsSave images in the database and then show in a listview
I want to save images by sqllite and then display them for a listView, but I don’t know how to do it. Can someone help? No need to show lines of code I just want to know the logic I should follow or…
-
-4
votes1
answer203
viewsDeployment problem for an application on Tomcat
I have an application running local, where I have deployed in the local Tomcat and works perfectly. I installed the same version of Tomcat and postgres database on another machine, which in case…
-
-4
votes2
answers456
viewsRead an excerpt from a String
As you saw my question above, I want to pick up only one part that interests me from a String, for example, I have a String preco whose text is R$ 20,00, how do I take only the number ? Another…
-
-4
votes1
answer81
viewsAn application for several databases!
Personal someone would have an example there about several accesses in a web system? that is I have several databases in the cloud , aii os usuarios vao entrar com seus logins e password e cada um…
-
-4
votes2
answers754
viewshow to access the jbutton that is in the other class?
I got the jbutton in the main class, so I put him in the public room so I could access from another class. but you’re not doing the right thing public class piscarbt{ tela t = new tela(); public…
-
-4
votes2
answers624
viewsCall javascript by passing php variable
I need to call a javascript by passing a php variable to it, when I put the whole script in php I can pass the variable this way location: '<?php echo $cidade;?>, BR', but when I call him that…
-
-4
votes1
answer804
viewsStatement from the Arraylist?
I have seen some examples of use and some use different Arraylist statement, List<> and ArrayList<> at first.
-
-4
votes1
answer154
viewsFunction to catch mouse drag coordinates
I am developing a java browser and would like to know how to create a function that stores the coordinates of the initial and final mouse using the mousePressed and mouseReleased. Grateful !
-
-4
votes1
answer539
viewsCPF Field Mask
How can I add a simple input mask? For example I want when I type the number appear 111.111.111/11, limit the amount of characters I already know, just wish I knew how to add these points and bars…
-
-4
votes1
answer61
viewsWhere should I put my database
Hello good afternoon I’m having doubts about where to put the database if you can put in a hosting or on a vps linux which two would be better ?
javaasked 8 years, 7 months ago Roo Oliveira 97 -
-4
votes2
answers919
viewsRead string and call in java voice
I wonder which API I can use in JAVA, for the following scenario, where I have a String with a password, for example, and the program read the String and Chava by voice.
javaasked 8 years, 5 months ago Jessé Santos 3 -
-4
votes2
answers54
viewsMounts a vector with 5 students, in the fifth student this vector multiplies by 2, being able to give input to 10
private Aluno alunos[]; private int ultimaPosicao; public int tam=5; /** * Construtor */ public VetorDeAlunos(){ alunos = new Aluno[tam]; ultimaPosicao = 0; } /** * Metodo para inserir aluno na…
javaasked 8 years, 3 months ago A. Fernando 199 -
-4
votes2
answers116
viewsHow to keep the last 100 objects inserted in an Arraylist?
How to keep the last 100 objects inserted in an Arraylist? This will be constantly fed but I want to keep only the last 100.
-
-4
votes1
answer5876
viewsJava Import all classes from another package
I have 2 packages, I would like to import to package B all classes of package A.
-
-4
votes1
answer70
viewsScreen Size of Smartphones
I am producing an app. I would like to know for which size of android smartphones screens I should program the layout. The layouts I made do not fit on smartphones with screen 2.7,3.2, 3.3,3.4,…
-
-4
votes1
answer44
viewsSend message from button
I wanted to ask how can I send message from a button or message this written on that button
-
-4
votes2
answers61
viewsNullpointerexcpetion
Hello stackoverflow friends, I’m finishing my calculator and I’m having nullpointer problems, I’m new in java and do not know how to change the logic to solve the problem, there goes the code I’m…
-
-4
votes1
answer558
viewsHow to read and display data in Android Studio?
How to read the data typed by the user in an Edittext and display in a new Activity in Android Studio? I’ve tried a few ways, but when showing it in the other Activity only appears "false".
-
-4
votes1
answer123
viewsHow do I import a. jar file without using an IDE? (Java)
Ex: I have a. jar file that I need to import in order to access the api, how do I do it right in the code? I don’t know if I was specific, but how? (No IDE)
javaasked 7 years ago DoutorWhite 111 -
-4
votes1
answer108
viewsLogin screen - cannot log in a user, admin or user
users table; create table usuario( usuario_nome varchar(15) not null, usuario_senha varchar(15) not null, primary key (usuario_nome) ); permission table; create table permissao( usuario_nome…
-
-4
votes2
answers48
viewsRedirect Java Script or HTML
I would like to be doing the same redirection based on user’s location. has this possibility? ex: if he is in Brazil remains on the site. if he is from another country is automatically redirected to…
-
-4
votes1
answer291
viewsCalculate time average in Java
I would like to know how to calculate the time average through a table in java? What I want to do is that when the user searches a client, it will appear in the table only the information of the…
-
-4
votes1
answer81
viewsJava Help: Save a Key-Value Arraylist in a BD
I would like to know how to save a key and value Arraylist in the database using Java; I had already made an implementation earlier in php similar, whose I created the array and used the function…
-
-4
votes1
answer271
views -
-4
votes2
answers678
viewsPayment by android card
I am developing an app to buy snacks and need to sell with credit card I started to observe the API of the pagseguro and I have the following doubts : It is the best api to integrate ? I need some…
-
-4
votes1
answer697
viewsJava calculator
I have a creation lock here pfvr help me, I would like to put a "AC" to reset the result anyone can give me an idea? My code is like this: private JButton numero0; private JButton numero1; private…