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
answer23
viewsHow to compare a typed Jtextfield String with a randomized Imageicon in a package?
At the level of Random in a package of Imageicon of flags of countries how to compare if it was typed right the name of the flag of the country in a Jtextfield by the user? To randomize the images…
-
0
votes0
answers18
viewshow to take firebase data and put it into a textview?
I want to take the user data registered in Firebase and put them in a Textview, but I’ve tried several ways and none worked. Code of Profile Fragment: public class PerfilFragment extends Fragment {…
-
0
votes1
answer24
viewsHow to pass a parameter from an Activity b to Activity A
Good evening, I need help to solve the following problem, I’m doing a Million Dollar Show style game. I have a main activity that is where the questions occur and has the buttons that trigger the…
-
0
votes1
answer27
viewsHow do I search the database using a String in an Apirest?
Hello, class! I am studying developing Apirest with Spring Boot. But I am facing problem when I will make an appointment through String. Through id works normally, but when I add the search method…
-
0
votes0
answers33
viewsSystem using Java and Mysql Database does not recognize user and login even while in the database
I am making a Java Services Order System in Netbeans based in this course. I created the database in Mysql Workworkbench, created the user table, connected to the server in XAMP and made the…
-
0
votes1
answer50
viewsWho is the instance, who is the instance? Java
Hello, I’m new with object-oriented programming and programming in general too, but in an example like the following: public class Profissao{ public void trabalhar(){ //trabalho... } } public class…
-
0
votes1
answer51
viewsConstructor <Classadapter> in <Classadapter> cannot be applied to certain types
I’m trying to implement a Searchview next to Recyclerview to make filtering book records occur. I am having problems in the following file line ListDonos.java: Row: recyclerAdapter = new…
-
0
votes0
answers11
viewsProblem with controller in Scene Builder in case it does not recognize error
Hello folks apparently I am trying problem for Scene Builder to see my package controller, file: Loginverification.java and already looked the way and at first it does not seem to be the root cause…
-
0
votes1
answer12
viewsHow to insert a list of records into an adapter for filtering functionality in Android Studio?
I am having a certain difficulty in solving a listing problem via an adapter in the file ListarDonos.java. The problem I mention is in the following line of the same file: recyclerAdapter = new…
-
0
votes0
answers16
viewsCheck time interval in another time interval (java)
Given a time frame, I need to know how many hours are longer than 22:00 and shorter than 05:00 LocalDateTime entrada1, saida1, entrada2, saida2, entrada3, saida3; entrada1 =…
-
0
votes0
answers17
viewsRTD (COM) / communication error. Connectdata(Int32 topicId, Object[]& Parameters, Boolean & newValue)
I created a client to communicate with RTD server, my knowledge is small in C# I have higher in JAVA, but I did not find anything likely to use in JAVA, I am using this example of client c#: using…
-
0
votes3
answers55
viewsUnsatisfied dependency Expressed through field 'cartRepository'
Good afternoon to everyone, I am taking a Spring course and using Redis, but I came across a mistake that has taken me many hours of study and so far I have not been able to solve it. Someone would…
-
0
votes1
answer26
viewsI can’t make a setOnItemClickListenner with a Long (Android Studio)
I have a Person class with the attribute "code" type Long. I have an error in this code block. Code1 is where I got the ID. list.setOnItemClickListener(new AdapterView.OnItemClickListener() {…
-
0
votes1
answer42
viewsHow can I reconnect to the database by putting variables on standalone instead of in Java code
I need to include the variables urlLot, user and pass in the standalone so you don’t have to change the code and recompile every time I switch environments. Unfortunately I can’t think of any way to…
-
0
votes0
answers16
viewsPermission Denial: Intent Service Mode
I am trying to start the activity of an android system application but is occurring the following error. Apparently you need a permit, how can I get such permission ? java.lang.SecurityException:…
-
0
votes0
answers16
viewsHow to use Reference in Firebase?
I am training in a digital point hitting app, and I wanted to know how I could create a rule for each user to be able to register 4 daily point i would have the Users document and the Records…
-
0
votes0
answers16
viewsHow to make a executable jar with glassfish and Grizzly
I would like to make a Rest application but I needed to be able to use a executable jar to climb the server so I don’t need an IDE, someone can tell me how to make a executable jar with glassfish…
-
0
votes1
answer29
viewsJava - Uninitialized "x" variable
I’m having a question: The code is as follows:: package yan.exercises.java.struct.repeat; import java.util.Scanner; public class exe2 { public static void main(String[] args) { Scanner scan = new…
-
0
votes0
answers11
viewsHow to pass URL dynamically using Feignclient Kotlin + Springcloud
In my code where I search a list of clients of a particular company, however according to the name of the client I must do the search in a certain third party Endpoint. In my example (below) come on…
-
0
votes0
answers18
viewsProblem when ordering information that is in an array! Javaweb
I’m making a system to train but I can’t solve a problem, I have a page where I download registered items and it has a quantity field, but after user type there the system is only reading 1 time and…
-
0
votes0
answers16
viewsNotifications with Jobscheduler is not working
I want my app to send notifications once a day, so I’m using Jobscheduler that looks newer (I’ve tried alarmmanager and there were other errors). However, I’m not getting any notifications, nothing…
-
0
votes0
answers10
viewsFill in Jtextfield from jComboBox
I have a. txt file with strings like this: luis;123;456;789;11/11/1111 The first part of my problem was popular jComboBox only with the first value (name), I managed to do some good, but now I need…
-
0
votes1
answer23
viewsStore CSV file data in a list
I am reading a 9 million-line CSV file, and I need to turn each line into an object and store it in a list or buffer to subsequently write to a random access file. When I try to add the investor…
-
0
votes2
answers42
viewsCompare the data of an Arraylist not to let register in duplicity - Java
Good afternoon to all I need to compare all the indexes of this arrayList with the Indice that is currently being added, it is possible? //MENU - CADASTRAR PRODUTOS private void cadastrarProdutos()…
-
0
votes1
answer20
viewserror: non-static variable this cannot be referenced from a Static context / Java 8
I am doing a URI (online Judge) exercise but is showing "Compilation error" due to error: Main.java:8: error: non-static variable this cannot be referenced from a Static context Interfacetext i =…
-
0
votes0
answers36
viewsI’m trying to keep this code of mine coming back in real time
I am with a saving command and wanted that when the user, who already used the command, wait 30 minutes but the code returns an error informing remaining time to use the command again as I do ? --…
-
0
votes0
answers29
viewsHow to make the spring batch Itemreader return a list by reading from a file
In Spring Batch does anyone know how to make Flatfileitemreaderbuilder return a list? Or if there is any other class that reads the file and returns a list? I have this Reader code: fun…
-
0
votes0
answers14
viewsI cannot "catch" an element in Selenium Webdriver
Hello, good evening! I’m having a problem capturing the password element in Webdriver. I put the label path and still can’t capture the password field. Has anyone ever had this problem? Also I could…
-
0
votes0
answers25
viewsRemove characters from a String (or generate a new one without them) that are between two special characters
I need some help in this case, I have a string and I would need to remove some characters from it. String minhaStr = "{"abcde{"fg":"hij"}" I need to remove everything between the keys {, ie in this…
-
0
votes1
answer43
viewsAdd the result of a variable to another variable
I have the following problem: I developed a report in iReport 5.5.1 where I added the data of a column into a variable because I need to show this total, and then I need to take these totals and sum…
-
0
votes0
answers9
viewsError while starting Tomcat
I am using the Adminlte project in the eclipse, having TOMCAT 10 as a server, and I am some time with error starting, I tried several dependencies but without success, someone who broke the head tbm…
-
0
votes1
answer34
viewsSecond degree equation
This is probably a question that has already answered too much here, but of course, I did not find the solution. The only thing I need is to take the calculation I made in main to another class,…
javaasked 3 years, 8 months ago Francisco Alan 13 -
0
votes1
answer23
viewsJava skips my scanner and won’t let me answer!
I am learning Java alone. One of the activities was the following: "Make a program that works like a calculator between two numbers any choice to calculate the sum, subtraction, division or…
-
-1
votes1
answer296
viewsProblem with string alignment
I have a problem in my Android project that I am not able to solve. I have a series of strings that are summed to form a larger string as the following example: String teste1 = "O.P. Processo…
-
-1
votes1
answer62
viewsCapture Linux logon event using Java
Hello, I would like a help to create a class that captures a user’s login event on Linux using Java.
-
-1
votes1
answer196
views"No view found" error closes my application
I’m creating a project with two screens, one with a button and the other with a list of phone numbers. Only when I click the button, the error message appears "Unfortunately app has stopped". My…
-
-1
votes1
answer516
viewsNullpointerexception at java.io.File. <init>(Unknown Source) in Java with Lucene
I’m getting the following error in my Java code Exception in thread "Thread-2" java.lang.NullPointerException at java.io.File.<init>(Unknown Source) at…
-
-1
votes1
answer747
views"If the "such" item is selected from spinner1, then "tal2" item from spinner2 is selected" how to do an if in that?
public void Spinner1() { Spinner spinner1 = (Spinner) findViewById(R.id.spinner1); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.curso_array,…
-
-1
votes1
answer177
viewsAndroid Webview Destroy
Opa personal I am with a certain problem when I run a Destroy in a webview. wb.getSettings().setAllowFileAccess(true); wb.getSettings().setJavaScriptEnabled(true);…
-
-1
votes2
answers1131
viewsPass JSP variable value to JAVA
Good afternoon, I am using JAVA and JSP to program. I have a JSP variable and need to pass the stored value to the JAVA code. I need to pass the variable "X" which is in index.jsp to the variable…
-
-1
votes1
answer468
viewsMethod does not return correct value
I have the following code: public class Main { public static void Main (String[] args) { Metodo R = new Metodo(); Scanner entrada = new Scanner(System.in); int[] valores = new int[10]; int i = 0;…
-
-1
votes1
answer317
viewsWebview - Classnotfoundexception
I’m creating the following canvas on android <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"…
-
-1
votes1
answer3097
viewsHow do I calculate Euclidean distance
I have a class Ponto: public class Ponto { public int x; public int y; public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y)…
-
-1
votes2
answers318
viewsjava.lang.nullPointerException Error
I’m doing an exercise in Java and it requires me to create a product note sold, containing random numbers plus the first three letters of the customer as product code, but when I try to generate the…
-
-1
votes1
answer95
viewsAndroid API used for program that cuts music
Which Android API to use for editing and cutting music? follows a link from an android app that does this: https://play.google.com/store/apps/details?id=com.herman.ringtone&hl=pt_BR Look forward…
-
-1
votes2
answers975
viewsBad Operand types for Binary Operator
I have to do an exercise for the college related to sales and in the customer class I need to apply a +fazUmaCompra method. Detail, I performed so far only part "a", I put everything in case help in…
javaasked 11 years ago leonardokbruksch 319 -
-1
votes1
answer651
viewsArraylist returning null values
Well, I have an array, I add values to that array, I send them to a method in another class that puts the values of that array into one string only and I add that single string into an Arraylist,…
-
-1
votes1
answer3237
viewsHow to display the values of an Arraylist separately?
class Principal { public static void main(String[] args) { Scanner entrada = new Scanner(System.in); ArrayList colecao = new ArrayList(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 2;…
-
-1
votes1
answer219
viewsLibrary for Processing Services
I have the source code below, but to work I need a library I can’t find, what I can do to solve? import ddf.minim.*; import ddf.minim.analysis.*; import processing.opengl.*; import…
-
-1
votes2
answers119
viewsQuestions about NDK
I am studying Android programming in Java, and what worries me is that I will only be able to get a portion of the job market, because there are IOS and Windows Phone phones and that does not use…