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
votes0
answers196
viewsHow to traffic real-time data with JAVA?
What is necessary to develop a Chat system, in which two people receive messages in real-time, and how to establish a connection between users' computers? The front-end is already developed, but it…
-
1
votes2
answers387
viewsProblems with if Else in Servlet
I’m messing with jsp. In mine servlet have if and else if and they both send to the same page, only with different values. However, when you enter the if(shows the result) and then when it returns…
-
1
votes0
answers94
viewsLine graph does not render (p:lineChart)
xhtml code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"…
-
1
votes1
answer179
viewsHow to use Futuretask class correctly?
I’m looking to calculate the number of numbers that can be divided by a splitter with no rest in parallel. The problem is the result of the method always return to half of what it should, it seems…
-
1
votes0
answers94
viewsHow to take the value of an id that is incremental and use it as a foreign key without using set/get?
I have a Primary key and needed to use it in another table like FK, how do I insert into the bank in a way that does not need to use the set or get modifiers?
-
1
votes0
answers85
viewsDoubt menu of Primefaces
I changed the color (Hover) when I move the mouse over the menubar item, but the icons are also disappearing, when I move the mouse over the image. How do I make icon not disappear? /* Cor menu */…
-
1
votes1
answer188
viewsHow to send a Bufferedimage by POST method?
Well, I was wondering how do I send a picture of the guy BufferedImage by a link using method POST. I’m using this code to send, but I don’t know how to send this BufferedImage. public static String…
-
1
votes0
answers725
viewsCould not find Factory: javax.faces.application.Applicationfactory
This error message only appears when I close and eclipse, after opening the eclipse again it generates this error in my project when I go up the page in Tomcat, but before all this my project works…
-
1
votes1
answer1036
viewsSave server images to my application
I am developing an application that after installed, the first time it is initialized it goes to the server to fetch all the images necessary for the user to use the application. I chose the library…
-
1
votes1
answer641
viewsThere is a standard size for increasing Tomcat memory
Hello, there is a standard size for increasing Tomcat memory, through the Xmx and Xms parameters?
-
1
votes1
answer1073
viewsProblem showing date on Android
When displaying a date that has been entered in the database, of type DateTime, the app shows the current date: I’d also like to convert that date to dd/mm/yyyy to adjust to a portrait layout. Part…
-
1
votes1
answer410
viewsWrite only one line in Bufferedwriter
Well, I have a text file with a few lines, for you to understand better, here’s what I have in this file: 0 Zombie+160+-50 Zombie+160+290 Robot+-50+120 Spider+370+120 doors 1+BossRoom1 3+Loja1…
-
1
votes1
answer399
viewsHow to open a packaged executable in the project?
I am running a program as follows: Runtime.getRuntime().exec("C:\\meuprograma.exe"); In which it works normally. But I would like to package the files (the executable and a few more) within my…
-
1
votes1
answer189
viewsAlarmmanager does not cancel scheduled alarm
I have the following code on MyReceiver: @Override public void onReceive(Context context, Intent intent){ context.startService(new Intent(context, BackgroundService.class)); } public void…
-
1
votes2
answers537
viewsWhen should I save my application data to the system registry?
I need to store some information of my application for when the user starts it again to be loaded the data of the last use. At first I thought about using the Windows registry (in this case I’m sure…
javaasked 9 years, 10 months ago Renan Gomes 19,011 -
1
votes0
answers18
viewsDoubts on how to develop a Skill bar
Good afternoon, I’m having difficulty finding anything about Skill bar, usually just find Skill bar percentage,e as the example image below, I wanted to develop a field where the user can add their…
-
1
votes2
answers643
viewsHow to set a time to close image when opening
I’m having a doubt how to set a time to image that was opened close. It would be a loop? I’m using ImageView: <ImageView android:layout_width="match_parent" android:layout_height="wrap_content"…
-
1
votes1
answer294
viewsHow to set a Spinner value to an object
I have the following table: <p:dataTable id="tabelaDisciplinasSelelecionadas" var="disciplina" value="#{disciplinaBean.droppedDisciplinas}" rendered="#{not empty…
-
1
votes0
answers120
viewserror running Javafx on Windows 7
I recently made a simple application on Macosx (Lion) using Javafx. But playing a few libs (jar) and implementing a few more snippets of code, the application stopped working on Windows 7. When…
-
1
votes1
answer610
viewsStatement and SQL Run Error - Netbeans
try{ Class.forName(driver); Connection conn = DriverManager.getConnection(str_conn, usuario, senha); Statement stmt = conn.createStatement(); String sqlinsert ="insert into cheque…
-
1
votes0
answers257
viewsJboss7 - JBAS015801: Invalid option
Hello, does anyone know how I can solve this problem? I already installed Avast and solved the "virus" problem on my machine, but now I can’t start Jboss. 14:31:07,232 INFORMAÇÕES…
-
1
votes1
answer96
viewsHow to prepare a Java object to be sent (with values)?
I have to send a serialized Java object, I already have this method that receives an object and sends, my doubt is how to set the values in the object, my data are in the database, just I take the…
javaasked 9 years, 3 months ago daniel12345smith 2,120 -
1
votes0
answers73
viewsJava EE Cloud Primefaces
I would like to know if Java with Primefaces and its managed Beans work well in the cloud, I mean, my question is whether this architecture supports working in the cloud to build a web system with…
-
1
votes0
answers129
viewsStart service with Timertask
I am trying to start an Android notification service with Timertask but returns me the following error: 02-03 16:06:00.164 15051-15379/com.celiogarcia.setapp E/AndroidRuntime﹕ FATAL EXCEPTION:…
-
1
votes1
answer81
viewsJava - Testing if VLC is installed
Hello! I am developing a mod project for Minecraft and I need to check if VLC is installed and Vlcj can run normally, in case you do not need to close the game is to show a message. Does anyone know…
javaasked 9 years, 3 months ago Enrico Rocha 58 -
1
votes0
answers31
viewsPlace Vlcj inside jar, along with libvlc
Hello! Today I saw one Stack Overflow post to use VLCJ without VLC installed, and wanted to put this inside a jar. Can you help me?…
-
1
votes0
answers275
viewsHow to maintain connection between Android Java server client?
When I call the server I should receive a message saying that connected, only when I send a message to the server the application overflows. This is the code of the button to connect to the server:…
-
1
votes1
answer317
viewsHow to convert TIMESTAMP/DATETIME to Gregoriancalendar?
How do I convert a TIMESTAMP or DATETIME mysql in a GregorianCalendar Java? Or a better idea? In class, the field dataCadastro is the type GregorianCalendar. I’m recording in the bank on the guy…
javaasked 9 years, 3 months ago Carlos Rocha 1 -
1
votes1
answer1724
viewsWhat is Recyclerview on Android?
What is the function of RecyclerView in an Android app?
-
1
votes0
answers185
viewsSqlite and Android database
Hello, I’m making a small app and need to search database data and display them on the screen. Databasehelper.java public class DatabaseHelper extends SQLiteOpenHelper { private static final String…
-
1
votes1
answer92
viewsHow to get the screen Density on Android via code?
I am developing an application where images and layouts adapt according to the logical density of the device. You can get the screen dpi from the device through Java?
-
1
votes0
answers408
viewsScalability with Java
Currently I hear a lot about how some languages are highly scalable. But how would a scalable system be in Java? That is, a high performance system capable of withstanding millions of simultaneous…
-
1
votes1
answer212
viewsSelect dynamic query button Submit and input
How to make a dynamic select in JSTL by a JSP? For example, fill CNPJ in a input id="cnpj" and when I click on the Submit button it takes that value from input, plays in SQL QUERY as parameter and…
-
1
votes1
answer150
viewsShared Preferences does not store login using JSON
I’m not able to save the login using JSON, it logs in but when I close the application and start again it didn’t save the login. private EditText editTextLogin; private EditText editTextSenha;…
-
1
votes1
answer51
viewsHow to list all Browsers installed on Android?
How do I list/check all browsers installed on an Android device via Java?
-
1
votes0
answers68
viewsTimertask with long intervals
I intend to develop an app that when setting a certain time, schedule a task with timertask to be executed 50 minutes later and soon after that 50 minutes, repeat by 50 minutes in a row. But it…
-
1
votes1
answer82
viewsError regarding the number of parameters in Query when not using Query, what is wrong?
I’m having difficulty using Hiberante/JPA with composite key, I believe the problem is there, although the generated exception stacktrace points to another place that is not superficially related to…
-
1
votes1
answer1876
viewsReturning database id in a global variable. How to fix?
After command insert, i can recover the id generated by the database using a global variable public static int returnID. But I didn’t think it was very cool to leave the variable static. Is there…
-
1
votes2
answers462
viewsHow to remove the text border in a component?
I have a program in Java and would like to remove these borders that appear in the button text: (The red edges were in the issue the ones I want to remove are those dark blue ones inside the red…
-
1
votes1
answer79
viewsdata persistence in two or more databases simultaneously
Greetings! I would like someone to help me with some example of a JSF application that persists data simultaneously in more than one database, that is: will connect there are 2+ databases and will…
-
1
votes1
answer658
viewsChange object in another method
What’s wrong with changing an object, which has been passed to another method ? , e.g.: public void doSomething(User user){ edit(user); //... EntityManager.persist(user); } public void edit(User…
-
1
votes0
answers26
viewsModify client side information
I am using signed applet to modify some information on client machine run some windows commands, this is necessary due to administrative part of the application. But applet execution is obsolete for…
-
1
votes1
answer496
viewsHow to use "drawRect" to draw on a component?
I am learning Graphics, but I can’t make a square: public static void main(String[] args) { JFrame tela = new JFrame("Snake"); tela.setSize(500, 500); tela.setVisible(true); Graphics g =…
-
1
votes2
answers186
viewsIs it possible to switch between Jdks in Netbeans working on a Maven web project?
I’m working with the java7 but now I have other projects Maven webthat were built for the platform java8, I’m using Netbeans 8.0.2. Before when I was just creating the web java project (not Maven),…
-
1
votes0
answers539
viewsHow to create a JSF shopping cart with Hibernate Postgres Glassfich and primefaces?
I need to create a shopping cart like in a E-comerce but all on the same page, and I do not know where to start, I am new in programming I am with many doubts. In my design I use…
-
1
votes0
answers31
viewsHow to capture keys with minimized program
I’m doing a Chat and would like when the user typed a letter (which he would configure) reopen the Chat that was minimized. How would I capture a key pressed even with the program minimized ??…
javaasked 9 years, 2 months ago Lucas Caresia 2,663 -
1
votes1
answer181
viewsHow do I popular an arraylist<Type> with a result brought from the mysql database, using Hibernate?
On many topics I see an excerpt of code that I can’t reproduce: Query query = session.createQuery() I cannot create this Session object using the createQuery() method. Can someone show me an example…
-
1
votes2
answers188
viewsProblems running Java class
When I will invoke the method of this class: package newpackage; import java.util.ArrayList; import javax.swing.JOptionPane; public class Operacoes { /* DESENVOLVIDO BY: "IIJM Team" */ Cliente…
-
1
votes0
answers69
viewsHow do I make a Jdialog invisible when I give Dysplasia in a specific frame?
A button of my application gives dispose in the current frame and creates another different one. But the JDialog that were open when I click the button continue to exist, which should not happen.…
-
1
votes0
answers48
viewsGive more than one event to a window
So I created a java window, but I need to assign a different event to it depending on the occasion it is called. And the problem is, I can’t do it. There’s a way to do it? Window:…