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
answer99
viewsSQL query inside java
I have the following query inside a file jsp in Java. String sql = "SELECT * FROM products WHERE productName = ? "; I would like my consultation to ignore Camel case and return all the words that…
-
-1
votes1
answer51
viewsGet full system memory and system components in java
Is there any simple or reliable method to take the total memory of the computer and/or the components or models of the computer components? I did a lot of research and the only thing I found was…
-
-1
votes1
answer261
viewsjava.lang.Nullpointerexception error
I have this mistake and I can’t find the problem. Exception in thread "AWT-Eventqueue-0" java.lang.Nullpointerexception at windows.TelaPrincipal.getUserList(Telaprincipal.java:53) at…
-
-1
votes1
answer19
viewsInputtex with 2 Managedbean
Good morning, everyone How can I pass the contents of an inputText to 2 Managedbeans? Example <p:inputText id=“usuario” value="#{usuarioBeanCelular.usuarioCelular}" /> <p:inputText…
-
-1
votes1
answer20
viewsAndroid class to trigger events, Batch Routine?
I need a class that, from time to time, tries to cross-reference database data and depending on the result send a notification to the user or modify/include database information. I don’t know if…
-
-1
votes1
answer22
viewsActive and root modifiers in java
My teacher passed some slides and he quoted two modifiers the root and the Active but I’ve never heard of them and from what I’ve researched they don’t exist in java, can anyone give a better…
javaasked 6 years, 7 months ago Eduardo Mior 525 -
-1
votes1
answer238
viewsTake CPU usage in percentage
How to take CPU usage in percentage in java? The closest I got was this code I tried to adapt, but it presents different results with respect to the Windows task manager goes below package teste;…
javaasked 6 years, 7 months ago Sávio Santos 13 -
-1
votes1
answer49
viewsError obtaining time with Row.getCell()
I’m getting data from a spreadsheet in excel. public void Hora() Cell horaAgen = null; if(row.getCell(7) != null ){ horaAgen = row.getCell(7); System.out.println("hora: "+horaAgen); } } On the…
-
-1
votes1
answer139
viewsRemove Branded in Android Studio editor
How to get this automatic branded Android Studio?…
-
-1
votes3
answers1432
viewsConvert Double to Integer
I would like that in the TextView where the value of "trees to restore" appears without a point or zeros. In the situation below appears "180.0000000" and should appear "180". Is he the type Double,…
-
-1
votes1
answer101
viewsWhy does the IDE indicate that a code in the "if" will not be executed?
Observe the code: Because the development IDE is not considering line 34, 35 and 36 code? You weren’t supposed to be on probation?…
-
-1
votes1
answer278
viewsHow to access a Managedbean through an external js file?
How do I access a Managed bean jsf through an external javascript file? I am trying to access it as follows: $("#botaoCadastroMaterial").click(function(){ '#{cadastroMaterialController.salvar()}';…
-
-1
votes1
answer867
viewsRecyclerview error: cannot find Symbol variable when running the Android Studio Project
My project when axecutar appears this error: Error:(417, 63) error: cannot find symbol variable testando Error location: The app’s Gradle has all the right Recyclerview Imports: apply plugin:…
-
-1
votes1
answer639
viewsEnvironment Sweeps Configuration - Commands Not Working - Ionic
You are showing the following error: 'Ionic' is not recognized as an internal command or external, a operable program or a batch file. But this command appears only in Cmder, at the Node.js prompt I…
-
-1
votes1
answer94
viewsOrganize items within Jtexarea
How do I pick up items from a combobox and place in a jTextArea, one below the other? Follows my code: public class PW_XML extends javax.swing.JFrame { int Grade; int Frequencia; int AttackRN; int…
-
-1
votes2
answers162
viewsFilter common elements in two Arrangements
How do I achieve a third arrangement with the intersection (common elements between the two arrangements) between two arrangements without repetition? int [] a = {1,2,3,4,5,6,7}; // arranjo 1 int []…
-
-1
votes1
answer265
viewsHow to run an application on multiple Threads?
I’m developing an interface application by Swing. The application aims to simulate a computer network in which I will monitor using the implementation InetAddress. Well, I created my interface,…
-
-1
votes1
answer79
viewsSave console output from an excel to a txt file
My code reads an excel spreadsheet and returns me a list of Ids, but when I try to save the output that appears on the console in a txt file returns me null. Does anyone know why? while ((output =…
-
-1
votes1
answer178
viewsHow to check the number of words in a String?
Well, I’m doing a job for college where I need to identify the number of words that a string has in Kotlin. Type : texto = "Ola Mundo" The variable numeropalavras has to be equal to 2. Is there a…
-
-1
votes1
answer40
viewsProblem calling a method on a jlabel
Good am trying to make an application in 2 screens the first to set the values and the second screen to exit the values the first is working normal Code: /* * To change this license header, choose…
-
-1
votes1
answer290
viewsError installing eclipse: Exit Code: 13
Hello! I am trying to install the eclipse in Ubuntu XFCE 18.04, with openjdk8 installed and the path configured in "/etc/profile": But still giving Exit code 13: I don’t remember very well if in the…
-
-1
votes3
answers2058
viewsAlways pick the last three characters without knowing the size of the string
I want to get the last three characters of a String. Example: String x = "OlaMundo" Exit: ndo I can even do it using substring, the problem is I don’t know the size of the String, I don’t know what…
-
-1
votes3
answers302
viewsSave value after JAVA comma
Hello, I need to take a value after the comma to do some operations, for example 175/10 = 17.5, I need to save this value . 5 as 5. My number will always be divided by 10, can you help me please?…
javaasked 6 years, 4 months ago Alan Santos 27 -
-1
votes1
answer718
viewsDelete a log from firebase auth
I need to delete a record from Firebase Auth, I am using the following code: FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); user.delete().addOnCompleteListener(new…
-
-1
votes1
answer145
viewsJavafx Screen Error
When I click to open the customers screen appears this error. Could anyone help me? Error: Exception in thread "JavaFX Application Thread" java.lang.RuntimeException:…
-
-1
votes1
answer746
viewsSqlite giving "near "CREATE" error: syntax error (code 1):"
Does anyone know what’s wrong to be making that mistake? I/System.out: ERRO 1 :android.database.sqlite.SQLiteException: near "CREATE": syntax error (code 1): , while compiling: CREATE TABLE…
-
-1
votes1
answer436
viewsException in thread "AWT-Eventqueue-0" java.lang.Indexoutofboundsexception: Index: 0, Size: 0
I need to open a file txt and store his information in a ArrayList and then make a comparison between what was typed and what is in bad ArrayList to see if the login is right or not. Just follow my…
-
-1
votes1
answer166
viewsPass data contained in Arraylist to attributes of an object
Through Scanner, I read a file . htm and pass the data contained in it to a String Arraylist. I need to assign this data from Arraylist to "game" objects. The Game class already exists, with all…
-
-1
votes1
answer114
viewsJava Web Project
To program Java Web, you need to use the Javaserver Faces extension or I can only use HTML pages with Servlet? And what’s the difference of using without JSF?
-
-1
votes1
answer583
viewsRead a txt file from a particular layout
I need to read a file txt that has various values. Example: 41976127992Jhonatan 3129176513 Only I want to take only parts of these values based on a layout, for example: CPF = Posição 1 a 11 Nome =…
javaasked 6 years, 2 months ago Jhonatan Prats Bulgari 11 -
-1
votes1
answer511
viewsArray[] in database, how to create and manipulate?
I own a array of integers, a int[]. Is it possible to save it directly to the database without having to Serialize? For example: CREATE TABLE teste( numeros integer[] ); And then use SELECT numeros…
-
-1
votes4
answers2763
viewsAdd array elements in Arraylist and print values
I have two questions about ArrayList: Is there any way I can start the values without having to use the .add every time? For example, the normal vector uses int vetor[5]={1,2,3,4,15} and puts the…
-
-1
votes1
answer229
viewsHow to calculate the product of multiplication of the elements of an array of numbers?
How to go through an array of numbers and calculate the multiplication result of all their elements? For example, with [1, 4, 7] get 28, which is 1 * 4 * 7.
javaasked 6 years, 2 months ago Murillo Rodrigues 1 -
-1
votes1
answer13
viewsMvn -Prod removes line from <script> when running
Every time I run the command below to generate . War, if I added some new js (library) in index, it removes. mvn -Pprod clean package When I run the system through the IDE, it works normally. Any…
-
-1
votes1
answer451
viewsConfigure external Tomcat server
I would like to set up an external server in Tomcat, I am only able to create a localhost server, but I have a machine that I created as a server and I would like to use it to put my applications…
-
-1
votes1
answer217
viewsGetting the mouse coordinates out of Jframe
I have a Jframe implemented in a simple way with Mousemotionlistener in java to get the coordinates of a variable, and I am returning with gety() and getx(). So far so good, but when I noticed the…
-
-1
votes1
answer41
viewscheck in settter - java method
I am doing an exercise in java that asks to calculate the area of a rectangle, if the usurer type some number smaller or equal that "0.0" should appear an error message, but this verification must…
-
-1
votes2
answers651
viewsNormalize or other way to format String
I have this method: public static String trataNomeArquivo(String nomeArquivo) { return Normalizer.normalize(nomeArquivo, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "").toUpperCase(); } She…
-
-1
votes1
answer242
viewsWhat the structure of large Java projects would look like
In small web projects, we usually separate packages into DAO, Models and Controllers, but into large systems of the type ERP, with hundreds of tables, controllers and business logics, what this…
-
-1
votes2
answers54
viewsImplement a Layout in Android Studio
I want to implement a layout like this in Android Studio, I searched already in Google, but I did not know to refer to this type of bar I want to do, then I made this image. I think it is quite self…
-
-1
votes1
answer209
viewsHow to manipulate Database directly in Eclipse IDE?
It is possible, perhaps with some plugin, to manipulate (manage) Postgreesql databases with Eclipse IDE? I checked the Dbviwer, but has no option to create table directly from inside the Eclipse.…
-
-1
votes1
answer88
viewsLoad java file
I need to upload a file . xlsx that is in a directory to my tool. What API or implementation can I use to upload?
-
-1
votes2
answers1338
viewsHow to generate sequential ID?
I’m trying to generate a sequential ID for each user registered on the system, but all users leave with the same ID number generated. public class User { // ... int id=1; public void gerarid() {…
javaasked 6 years, 1 month ago Luis Gomes 7 -
-1
votes1
answer112
viewsTransfer system ( options)
Good afternoon! Guys, I’m a beginner and I wanted to know how to simulate a bank transfer (Account + Conta2), being "Conta2" a class created outside the Class "Account". I made the Withdraw and…
-
-1
votes1
answer148
viewsHow to add CR or LF to the end of the. pdf file generated by Stella.Boleto?
I managed a ticket of the Itau and was indicated to validate with the operator (bank Itau). The operator required to insert the special characters: CR+LF. How do I do that ?
-
-1
votes2
answers242
viewsHow to change the value of a jLabel with a jButton (Netbeans)
I’m a beginner in Java, and I want to create a supposedly very simple program. Inside a panel there is only a jlabel and a jbutton. jLabel has the value "0". When Clicking on jbutton, the idea is…
-
-1
votes1
answer99
viewsError in Java database
Hello, I "created" an application with user registration and login, after the login screen that comes the problem, the system to log in is working, started to give problem after I created a screen…
-
-1
votes2
answers260
viewsHow do I validate element (button) no longer present on the screen (was presented but is no longer) - Selenium Webdriver
someone can help me? How do I validate element (button) no longer present on the screen? It was presented. I clicked and the button disappeared (expected scenario). However, I want to…
-
-1
votes1
answer60
viewsGet multiple edittext results in a Recyclerview
I have a recyclerview, being that I am creating for each item in the list, an Edittext(via XML). Since the purpose of that edittext is to be filled with the amount of ITEMS that is desired. Soon…
-
-1
votes1
answer54
viewsComparing Lists in Java?
How to compare two Lists and add different record in a third list?? Ex: List 1(1,2,3,4) List 2(1,2,3) List 3.add(4);
javaasked 6 years ago Yury Rodrigues 9