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
votes2
answers112
viewsHelp in Nullpointer Exception
Before the data goes to the bank I’m with a nullpointer that already debugged and I can’t find where the problem is. Down with my classes: package br.com.pokemax.controle; import…
-
-1
votes3
answers1018
viewsCall another class (Java)
How do I call a "class" of type jFrame for example from my main class? My jFrame has its own main that gives the true setVisible for it to appear, but I wanted to access this main of it from my main…
-
-1
votes1
answer110
viewsHow do I move with a character in Jframe Java?
I wanted to know if how to make a camera for character when it reaches the end of the panel start going along with the character, because when setting a size this.setSize(500,500); the character…
-
-1
votes1
answer62
viewsHow to call the same task more than 1 time
I have the following task: Timer tempovolta1 = new Timer(); TimerTask tarefavolta1 = new TimerTask() { @Override public void run() { jButton1.setBackground(Color.BLUE); } }; I want to call her…
-
-1
votes1
answer171
views -
-1
votes1
answer172
viewsValidate blank fields
I have a form with 3 fields to be filled and stored in bank. One of the fields is filled by the system the rest by the user. boolean isInserted = myDb.insertData(editNome.getText().toString(),…
-
-1
votes1
answer89
viewsHow to create a list with Months to change the Datatable result?
I have a dataTable that brings the data of a specific month set in DAO. I would like to create a field where I select the month and it updates the table with the selected month. You have to use…
-
-1
votes1
answer204
viewsDelete rows in multiple tables
I’m trying to erase information from two tables at the same time that are connected to each other but I’m not succeeding, give me this error: Somebody please help me?…
-
-1
votes1
answer163
viewsHow to make the correct proguard configuration?
How to make the correct configuration of proguard, bringing better security, smaller size and deleting classes when you want or when creating problems? Basically enable default settings in changing…
-
-1
votes1
answer721
viewsCreating Thread Dynamically with Spring-boot
Good morning earthlings, There is the possibility to make spring-boot create thread when needed and also kill the same ?
-
-1
votes1
answer385
viewsError in build. Gradle
Error:(1, 0) Plugin with id 'com.android.application' not found. Open File Guys I went to open a project, and this mistake came up. Can someone help me, please.…
-
-1
votes1
answer564
viewsCheck user status when logging in
Hello, folks. I’m having a problem formulating my login screen and would like to ask your knowledge. I’m using Eclipse Mars . 1 to program, Primefaces for visual components and Spring Security for…
-
-1
votes1
answer34
viewsHow to pass a url to a server in java
I’m auditioning for my college project, and I’m having a problem. I create an object and pass all its data through the Tter and the constructor. When I call Service with the save method, it returns…
-
-1
votes1
answer290
viewsPorting Java code to C++ or Python
I’m working on a project that was originally written in Java. I want to learn more about the mathematics and the logic behind the code, and I had the idea of porting the code to another language. I…
-
-1
votes1
answer67
viewsRun windows features with Java
I am developing an Nfe emitter and has an option in windows that allows you to select which certificate to use. I wonder if anyone knows how to call this windows feature using Java.
javaasked 8 years, 8 months ago José Allison 229 -
-1
votes1
answer2120
viewsList the 10 Best Selling Products
I need to list the 10 best selling products from a table using Hibernate. The table item_sale has the following columns: amount id_product valor_unitario value_sub_Total…
-
-1
votes1
answer2491
viewsSend email with java
Good afternoon. I’m using java, JPA, wildfly and primefaces. You need to send a notification email after the user clicks on the send button. How do I send emails through java?
-
-1
votes1
answer294
viewsError, I cannot save in bank using Hibernate
Good afternoon Pessoa, I need your help! I have a problem in my project, my Hibernate is working creating tables but when I tried to save it does not work and the following error appears in junit(…
-
-1
votes1
answer225
viewsSave user input to a loop
I want to get the variable list numeros, generated by the following loop: Scanner kb = new Scanner (System.in); double [] numeros= new double[10]; for (int i = 0; i < numeros.length; i++) {…
-
-1
votes1
answer62
viewsSave several variables in an Edittext
Hello, my problem is how to save different strings that are written in an Editview. I can save a variable every time a button is pressed. But I don’t know how to save another string in another…
-
-1
votes1
answer104
viewsAdd scroll in window
I created a window that was Width 360 x Height 800. Only 800 height can not be seen on the monitor. How do I add a scroll in the window?
-
-1
votes1
answer267
viewsException in removing the last element of Arraylist
My Problem: I have an Arraylist of an object that represents the number of lines in my Jtable, model class. well, all the other methods are working perfectly, the problem is the remove() I have no…
-
-1
votes1
answer123
viewsIntellij, Spring Boot and Angularjs
I’m running a project Spring Boot e AngularJs no Intellij and I’m trying to access the folder webapp by navigating (localhost:8080/nomedapasta/index.html), only you’re making a mistake (There was an…
-
-1
votes1
answer375
viewsdoubt block page transition via URL
I have a question I would like to know how to block any kind of transition of pages via URL regardless of whether the user is logged in or not, for example if I am on the home page.xhtml can only go…
-
-1
votes3
answers886
viewsFragment error "Unable to start Activity"
My error application when opening on a tablet and I can’t identify the error it informs that I have to enable: Unable to start Activity…
java android android-layout android-fragment android-activityasked 8 years, 7 months ago Everton de Freitas 41 -
-1
votes1
answer588
viewsJava system sending message to mobile
Speaking personally, I am developing a Java web application with Eclipse Maven, to use in a small office, cloud-run system and access by office computers. I was asked at the end of a launch, that a…
-
-1
votes1
answer910
viewsHow to connect a link to an object? Servlet
It was made a solution proposal in Servlet, I have a form elaborated in html, save the data in a database, take this data and dispose in an html table, in this table has the attributes of the person…
-
-1
votes3
answers3735
viewsGenerate random number between two numbers with Math.Random
I need to generate a random number between 1000 and 9999, found the following formula: (int) (min + Math.random() * (max+1)) Code: int numeroAleatorio = (int) (1000 + Math.Random() * 10000);…
-
-1
votes1
answer88
viewsArraylist bugger
Using the command .clear of java.util.ArrayList; the command resets the array of my graph object as well but I just wanted it to reset the arraylist sucs, follow the code: import java.io.File;…
javaasked 9 years, 7 months ago João Carlos 445 -
-1
votes1
answer73
viewsConnection to Hibernate, java.lang.Nullpointerexception error
Connection with Ibernate I have an application where I realized all the necessary settings to run the project following the company manual, I happen to have an error in opening the same related to…
-
-1
votes2
answers659
viewsHow to use the Clipboard to copy and paste
How to use the clipboar android, to copy a text from a textView, I need to copy this text and use to paste elsewhere.
-
-1
votes2
answers976
viewsHow to calculate the time difference?
` package layout; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import…
-
-1
votes1
answer477
viewsHow to break (split) strings and put result into separate variables?
public class Teste30 { public static void main(String[] args) { // TODO Auto-generated method stub String teste = "Isso funciona mesmo, ok?"; String [] vetor = teste.split(" "); String aqui = null;…
-
-1
votes1
answer138
viewsHow to concatenate strings from a 3-in-3 vector in Java?
I need to concatenate the elements of a 3-in-3 vector. Follow the sample of what I need: package ex; public class prog { public static void main(String[] args) { // TODO Auto-generated method stub…
-
-1
votes1
answer461
viewsHow to assign action to Image or Button
I am developing the home page of a simple game, what I wish is to add a button on the screen where when clicking the game start, follows below my code of how I am mounting the menu and bringing the…
-
-1
votes1
answer40
viewsisEmpty() method giving error in a while block
Hello. I am developing a board game and in the method below I want to check if in the matrix of integers x any position has been set or is vasia. Error in line: while. public void…
javaasked 9 years, 7 months ago André Nascimento 1,258 -
-1
votes1
answer528
views -
-1
votes1
answer58
viewsRun a function from a class
I wonder if there is possibility to perform a certain function only when the Activity is called by another determined Activity specific. for example: Activity A called the Activity B, in this case…
-
-1
votes1
answer110
viewsHow to create a standard typing format in an Android Studio form?
Type: abc@def Must have a (@) in the middle between the seven characters typed.
-
-1
votes2
answers959
viewsHow do I take the content of a text that is on the link (URL) and upload it to Textview?
I need a way to load through a URL a text that is in it. The text is large, and this way the application would be lighter. I want to set the text that is downloaded from this link in a TextView.…
-
-1
votes1
answer457
viewsEdit Record Using Jpa
Good morning Personal, I’m trying to edit record. well the scenario is the following have my screen edit that is bringing me the data correctly. but when I do the editing it updates on the screen no…
-
-1
votes1
answer417
viewsHow to extract sentences from a text in Java?
I recently read an article that analyzed the size of the sentences of several authors. It was a stylistic study of his works. How do I read a text (with several paragraphs) and extract your…
-
-1
votes1
answer318
viewsHow to use CDI in Webservice?
I’m trying to inject a bean @Injection within a WebService, but the bean always stays null. Dependency injection is working in my project. When I use @Injection within a Managebean to a jsp page…
-
-1
votes1
answer3136
viewsAn error occurred while performing resource injection on the managed bean paisControler
Trying to start a system page shows this error. I’ll put the codes: DAO package br.com.netsoft.desif.dao.endereco; import java.io.Serializable; import java.util.List; import…
-
-1
votes1
answer1961
viewsJtextfield does not interpret n as line breaking
When printing customer data in Jtextfield, when the \n is present means a line break, but instead of moving to the next line each time you find a \n, he simply ignores and continues to write in…
-
-1
votes1
answer49
viewsDoubt about saving a data and updating a div right away
Good morning, everyone. Only with jQuery and Ajax I can insert a data into the database and then update a div on the page ? Thank you.
-
-1
votes1
answer1017
viewshow to resolve accent errors when sending an Android message to a php API
Guys, I’m having trouble sending strings with accentuation and strings with 2 lines or more. When sending without accentuation or and with only one line it normally accepts, however, when sending…
-
-1
votes1
answer205
viewsCreate an exception on purpose
I can create an exception by dividing a value by 0 in this way: try { int res = 100/0; } catch (Exception e){ Log.wtf(TAG,"Test Exception"); } But I don’t know if it would be the most viable way.…
-
-1
votes1
answer578
viewsHow do I boost code on android?
I will make a calculator that needs potentiation, someone can tell me how it is done on android?
-
-1
votes1
answer907
viewsHow to search for the html input text?
I want to do something like Google, where you start typing and will appear the list of options according to what you entered, where these options are already registered in the database... EXAMPLE: A…