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
answer24
viewsI’m having doubts about updating a Jframe, Help Plz
I’m trying to do a quiz. So I would like to update the same "screen" or frame - as you like - that is, you have the first question, the user responds and the frame updates with a new question and so…
-
-1
votes1
answer496
viewsUsing Stack, how can I check if one string is the inverse of another?
EX: x = "ABABBA" and y= ABBABA I’ve done the class Pilha, with the methods, but I am doubtful how to implement. package questao02; public class Pilha<T> { T[]arrayelem; int topo; int index =…
javaasked 5 years, 7 months ago user160874 -
-1
votes1
answer180
viewsTextview findviewbyid Fragment Mainactivity
I’m trying to give a setText() in Textview q is in Fragment , but returns me this error: E/AndroidRuntime: FATAL EXCEPTION: main Process: kcollector.com.br.kvendedor, PID: 24201…
-
-1
votes1
answer52
viewsJava.Util.Set does not add new elements
In the store variable when trying to add a new element of type "Store" it always stays with only one element and does not add a new element. And never add a new one. Follow the codes: Metodo main:…
javaasked 5 years, 7 months ago emanuel cavalcante 518 -
-1
votes1
answer73
viewsCheck for loop object existence
I am running a loop that should iterate 30 times that corresponds to the days of the month... and this loop is iterated with data coming from the database that brings the days of registered items…
-
-1
votes1
answer401
viewsHow to get the value of an Object that is inside an array of objects > java?
I have a list of boletos in my GRID and I need to select some to have only the selected ones printed, so I am passing as parameter lArc_dados(grid) so that I can at the time of logic pick only those…
-
-1
votes1
answer60
viewsConfigure JPA to recognize uppercase Postgresql entities and tables
Recently I am working in a project that uses as DBMS Postgresql. In the database all tables and columns are in "UPPERCASE". Example: CUSTOMER - ID_CUSTOMER - NAME - DESC When it comes to mapping…
-
-1
votes1
answer47
viewsPerformance JSON x Properties in Java
Good night. I used to use several files .properties to save the data from the desktop application I develop. I studied the possibility to exchange these files for files .json, because I see that…
-
-1
votes1
answer113
viewsJava - Spring 404 - not found
I am developing a Java application with Spring Boot, however, Controller is not able to find HTML, apparently... Page not being found Previsão do tempo <table class="table"> <thead>…
-
-1
votes1
answer70
viewsReal Time File Search
I’m trying to make a program that provides real-time file search feature. As the user type the name of a directory in the text box, the program should search and display in the text area the names…
-
-1
votes1
answer105
viewsread a series of json elements (gson)
Next, I’m trying to write a java method that reads a series of json objects using Gogle’s gson. It’s just not working. I don’t know if it’s my code or my file, they’re both down there: customer…
-
-1
votes1
answer324
viewsProblem running file . jar created by Intellij
I’m trying to create an executable using Intellij. I followed all the steps on the official website, in addition to several tutorials on youtube. I was able to create the executable and run it…
-
-1
votes2
answers125
viewsExit loop For when typing note 1
This code I’m writing, where the option 1 the user enters notes that he wishes to insert into an ATM where it was to stop when the note 1 was inserted. In the option 2 is to enter the value of the…
javaasked 5 years, 6 months ago Ian Fonteles 11 -
-1
votes1
answer1402
viewsManipulating class within another class and saving in array
I created a class Pessoa and in it an attribute endereco, only I made a class Endereco to register more than one endereco per person. In that other class Endereco has id and nome da rua, and I can’t…
-
-1
votes2
answers745
viewsRemove characters from the middle of a String
Write a program that, starting with a word defined by you, prints on the screen the words resulting from removing, one by one, the middle characters of the previous word, until you reach a word with…
-
-1
votes1
answer125
viewsHow are these Setters methods not being used?
I’m creating a Java/Android app where your job is basically to display a list for the user about what items we still have available in stock. To make this list I used a Recycler View, data (stock…
-
-1
votes1
answer284
viewsHow to return the selected item from a spinner
How to pass to a variable the value selected in a spineer at the moment the user selects some of the options? I tried to implement this option, but I was unsuccessful. Follow my code in case anyone…
-
-1
votes1
answer71
viewsIs it possible to simulate the C++ 'Friend' keyword in Java?
Is there any way to simulate this in Java? I would like to have access to a private builder of one class in another, but this other class cannot be nested. This is for the logic of a game where I…
javaasked 5 years, 6 months ago NinjaTroll 1,752 -
-1
votes1
answer3147
viewsOptions menu in the JAVA console
Hello, I’m new to the language, I’m an intern at a programming company and my boss asked me to perform a small program to exercise my learning, asked me to make a menu on the console in java. -each…
-
-1
votes1
answer351
viewsAdd profile to Webdriver Firefox
Good morning I am automating a website, and to run some features it is necessary to use an extension in the browser. First I was trying to add the extension to the web driver with the FirefoxOptions…
-
-1
votes2
answers87
viewsInsert Widget into a list with Defaultlistmodel [JAVA]
all right? I am creating an application that needs to show some elements registered in a list, which I will show through Defaultlistmodel. Unfortunately within the application it recognizes the…
-
-1
votes1
answer94
viewsSwing - Include images in JAR file
I have a project in JAVA, which has a graphical interface with a screen, developed with the Swing. I have 2 images, background and favicon, which are in the package: [code]br with drsolutions…
-
-1
votes1
answer99
viewsChatbot Telegram: Multiple conversations and messaging confusion
I’m making a chatbot in java on Telegram, everything flows normally, but when more than one person starts interacting with the bot, it stops working for other users, and it only works for one. I…
-
-1
votes1
answer82
viewsNotification icon modifies with closed app
When the App is open the icon appears normal, now when the app is not open only a circle appears instead of the icon. I have a system in Swing that when the user does a certain action is sent a…
java android firebase-cloud-messagingasked 5 years, 4 months ago jallisson jallis oliveira band 100 -
-1
votes1
answer31
viewsHow to popular only a part of the object with a query in Hibernate
Related to that question I asked earlier about Hibernate I am building a Restful API, and making a Join with 2 tables. However I would like to bring only some attributes from my Join table. Today my…
-
-1
votes1
answer91
viewsHow to reduce Page return fields in an API?
I am implementing pagination in some endpoints of my API and the return is a Page. This object returns many arguments, there is some way to eliminate some of them? The Repository extends…
-
-1
votes1
answer233
viewsError while trying to connect to Android FTP server
I am trying to connect to the external FTP server with the current lib 3.6 of apache ftp client using Android Studio, the version of my Android is 4.3 up to the current 9. In my Manifest I have: I…
-
-1
votes1
answer190
viewsMetodo Post spring boot 2.2.2
Well guys I’m having a problem, I’m starting to learn spring boot and when I’m doing the POST method always back the error saying that it was not found Controller package Controller; import…
-
-1
votes1
answer171
viewsRecyclerview does not show list data
I have a problem that when trying to list the data on RecyclerView it does not show the records, in Debug I check that the records are entered in the list 'ArrayList', follows the code. Method…
-
-1
votes1
answer76
viewsHow to update Jtextarea in each loop iteration with Swingworker?
I have a class that inherits from SwingWorker and I’m getting information from a file .txt and playing for the JTextArea, and would like to go running update of JTextArea while the loop is running,…
-
-1
votes1
answer37
viewsAndroid Locked When Calling API
I have this method in the main: private String token () throws IOException { String login = this.login.getText().toString(); String senha = this.senha.getText().toString(); Login dados = new…
-
-1
votes1
answer196
viewsProblem displaying dynamic image with Thymeleaf
I have an application, where the user can store the profile photo. Save the image in C:/imgPerfil/ concatenating the user id with the original image name. Example: "2test.jpeg". I need to show this…
-
-1
votes2
answers558
viewsJava Calculator Problem Using Switch Case
Hi, I have a problem with calculator, when you enter the switch case, does not change operation and does not resume to default. package aprimoramentos; import java.util.Locale; import…
javaasked 5 years, 3 months ago user174054 7 -
-1
votes2
answers245
viewsError 404 - The requested Resource is not available. Jersey REST
When starto the Tomcat he calmly calls the Hello World on index.jsp. But when I call @Path it gives 404. I’m calling: http://localhost:8080/backend/service/todosClientes. I’m wearing the Soapui…
-
-1
votes1
answer30
viewsI cannot display a Toast in 2 activitys from the same package
I am doing a registration screen and login in my app, in the registration screen I implemented some exception treatments toasts, at the time of emulating the app the registration screen toasts…
-
-1
votes1
answer79
viewsHow to inflate a custom view within a recyclerview view?
Following this example,I am creating an expandable recyclerview,to create a comments session and feedback responses in my app. It is possible to create a linear vertical layout, in which several…
-
-1
votes1
answer25
viewsHow to do an UPDATE with Sqel Expression?
I’m trying to do an UPDATE and I’m not getting it, someone can identify a point of failure ? @Query(value="UPDATE cliente SET nome = #{#cliente.nome} WHERE id_cliente = 1", nativeQuery=true) Cliente…
-
-1
votes1
answer375
viewsCheck if user is logged in to Mainactivity Android Studio
I have an app that successfully logs in, but when you log in to Mainactivity it simply disconnects from firebase auth, Listener is 0, how can I keep the user logged in after logging in too…
-
-1
votes2
answers217
viewsMigrate data from one table column to another table column
I work in a company where we implement a new functionality in our system, but previously a field of our table was bug_passos varchar(500), now with the new implementation, we create a new table with…
-
-1
votes1
answer188
viewsDIJKSTRA IN JAVA
Hello. I am implementing a graph and as a smaller path algorithm, I am using DIJKSTRA. The graph indicates the relation of genders and their respective subgenera. The graph is directional,…
-
-1
votes1
answer52
viewsError while sending email
I have this error when sending email that occurs right in this code snippet. Basically it’s a form that receives two pieces of information and sends it to a predefined email.…
javaasked 5 years, 2 months ago Cleiton faria 1 -
-1
votes1
answer438
viewsHow to enable CORS in Java projects with JWT implementation?
I am doing a web service project, where I implemented the JWT and to consume using Reactjs I enabled the CORS, but when I make a request that needs to have the token, this returning it: Access to…
-
-1
votes1
answer198
viewsArray Creation in Kotlin : No value passed for Parameter array [init]
kotlin array Converti um código de java para kotlin, porém está com um erro que não consigo resolver Here is the java code public class IntroActivity extends AppCompatActivity { private ViewPager…
-
-1
votes1
answer50
viewsdatabase connection
Hello, I’m having a problem with mysql_connector, because it’s not returning me the connection string with DB, even though I’ve already included it in the Netbeans classpath, and have done other…
-
-1
votes1
answer65
viewsHow to make the program continue where I left off after an exception happens in my Ry
In this excerpt I got the expected result, which was not close the program after the error message if the user enters with wrong data. However, even if I’m in the 10th, it resets to the first. So…
-
-1
votes1
answer87
viewsDoubt which variable to pass from my Select
I have two selects, both consult the database. I have Equipment, and Operations... When selecting equipment x in select, I will consult the database for the select Operations to pull only Operations…
-
-1
votes1
answer354
viewsHow to recover object ID in Jquery table row
Guys, here’s the thing, I get the database data and I set up a table with all this, I need in each line to store the value of the client id coming from the bank too so later I can delete, change…
-
-1
votes1
answer106
views@Autowired service does not work on Constraintvalidator in Kotlin
I’ve been using Spring Boot for some time in Java and never had a problem with injections using @Autowired. But recently I decided to transform a Rest API project that was in Java to Kotlin, all the…
-
-1
votes1
answer198
viewsCalculate difference between two schedules
I’m having second thoughts about the logic of this code: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int horaInicial =…
javaasked 5 years ago Kelven Rodrigues 63 -
-1
votes2
answers3288
viewsAdding values from an array
Storing values in array but cannot sum values. package primeiro; import java.util.ArrayList; import java.util.Scanner; public class Testes { public static void main (String[] args) { Scanner scanner…