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
-
2
votes0
answers155
viewsTreeview - Jtree (Netbeans) Adding a description to a selected node
I am doing a simple treeview in Netbeans and would like to know how to add a description to a selected node by means of a button that has a function that will associate to a lable. the code for the…
-
2
votes3
answers124
viewsDifferences xml lines Android (Eclipse)
Guys, in the course I do Android he works on the platform Eclipse(Old version) and I in the latest version, when the teacher uses the command: android.id in it’s all right, but if I type this line…
-
2
votes1
answer130
viewsWhen using recursion method returns 0
I have the following code: public int lerInt() { String entrada = ""; int saida = 0; try { entrada = input.readLine(); } catch (IOException e) { System.out.println("Falha critica."); } try { saida =…
-
2
votes1
answer4105
viewsCalculator using Java Socket
I’m doing a job at the college and I took some information from the Internet, the professor asked a client to submit 2 values and a basic operation, the server should take this and return the total.…
-
2
votes2
answers977
viewsHow to use JSON response?
After a lot of trying I arrived at this result of JQUERY AJAX, but I still could not use the JSON data, they do not work, how should I do ? give a Help ! thank you The JSON response ta at the end…
-
2
votes1
answer1330
viewsInheritance with jpa
Hello, I have a class called Usuario that is abstract and I have the class UsuarioComum and Administrador which they inherit from Usuario, I am using JPA annotations to generate the automatic…
-
2
votes1
answer527
viewsjava.lang.Nullpointerexception in this code
This gives java.lang.Nullpointerexception error in these two classes. import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JTextField; public class…
-
2
votes2
answers2363
viewsClose all open jframes when opening a new one
How can I close all jframes opened in my project when I run an action that opens another jframe? I have a login system and when necessary, I invoke another frame to define a password. After setting…
-
2
votes2
answers842
viewsHow to add a JAR library to a Java project without IDE?
Save. I’m having trouble adding the Jfreechart library to my Java project (using Windows 8). I’ve unpacked Jfreechart, but I don’t know what to do from there. Since I’m an old school programmer and…
-
2
votes0
answers2377
viewsWhat is this error javax.servlet.Servletexception: getOutputStream()?
I am generating a report, the moment I click to issue and it displays this error. Exception: javax.servlet.ServletException: getOutputStream() has already been called for this response at…
-
2
votes1
answer73
viewsHow to decode an object via URL?
I have the object URL and I needed to encode and then de-perform, how do I do that? The URL is from a server that displays a Java object encoded and serialized.
javaasked 9 years, 3 months ago daniel12345smith 2,120 -
2
votes1
answer348
viewsCheckbox checked/unchecked does not obey instructions
To Activity is started with the layout activity_home and the CheckBox unchecked. When I touch CheckBox, the layout becomes the activity_home_avancado, however the Checkbox remains unmarked. At the…
-
2
votes2
answers267
viewsLock F5 key in the application
Good afternoon, I am developing a Java Web application, and found that after performing a registration and typing F5 the information gets duplicated, only the ID that does not duplicate because it…
-
2
votes1
answer486
viewsDownload via FTP with Javascript
I would like to know how I can be putting on my page the user option to download via FTP. I do not want the user to enter the information for access to FTP and also that he does not see the FTP data…
-
2
votes2
answers437
viewsSelect if the collection contains a particular object with Hibernate Criteria
I’m trying to make a query that would be something like the method contains of interface Collection java. I have a class GrupoProdutos and want to select the groups if your Collection, calling for…
-
2
votes0
answers33
viewsWhat is the possible cost of using blocks for exception treatment in too ?
As exceptions are interruptions caused most of the time by the operating system, I wonder if there is any cost of memory (stack/heap) since, existing exception treatment the program continues to run…
-
2
votes1
answer1150
viewsCreate graphical interface using Miglayout
I need to create this graphical interface: The last code I tried was this: (but the settings are not correct) frame.setLayout(new MigLayout("wrap","[grow]","[grow][]")); panelInfo.setLayout(new…
-
2
votes2
answers711
viewsHow to persist the String of an Enumerator in the Database?
I have the following Enumerator: public enum ETipoCasa{ Propria, Alugada, Financiada, Cedida; } And I’m trying to persist in the database the string of this enumerator as an example: Casa casa = new…
-
2
votes1
answer402
viewsWhat is the best way to develop a video player from scratch?
Well, I would like to know what topics, articles books finally references would help me in the task of developing a video player from scratch as the average classic player for example?
-
2
votes0
answers54
viewsUpdate Main via an Intentservice
I have an application that works together with GCM (Google Cloud Messages), which consults the server and when there is news sends a notification to the user. I need to update my Mainactivity…
-
2
votes1
answer1966
viewsWhy is my app not compatible with some devices on Google play?
I posted an app on google play, but unfortunately it’s not available for some of my devices. I am very confused, because in the development with Eclipse, I used the same devices for testing and they…
-
2
votes1
answer628
viewsHow to use variables in a location outside the scope where they were created?
I have the following code: public class TracoActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
2
votes0
answers55
viewsProblems when closing RAD screen splash (v7.5)
I’m having an unusual problem (who doesn’t?), My Launcher/splash screen opens, but it keeps this state even after I choose the desktop and after RAD loads the project. It only closes when I stop all…
-
2
votes1
answer573
viewsTabs on Android
I’m trying to implement a simple code just to show two tabs on Android and later add a content dividing into two activities, one to show examples with IF and the other with SWITCH. I created the…
-
2
votes1
answer49
viewsPhp script in java ? runs in the background?
I have a question. I have a script which takes about 40 seconds to execute. I’m thinking so if I have run on android, the user if not willing to wait the 40 seconds, what happens he closes in the…
-
2
votes2
answers202
viewsHow to optimally read a list of Arraylist dependencies?
I’m in four classes, each class has one ArrayList, where the last element depends on another ArrayList: Example Genêro->Artists->Albuns->Music To read the songs I’m doing as follows. for…
-
2
votes1
answer72
viewsJavacv applet does not display video in the browser, only on the desktop
I am developing a web application that connects to a security camera via Javacv. The applet I developed runs normally on the desktop, but when I try to run in the browser, although it does not give…
-
2
votes2
answers814
viewsChecking Time in java
Given a list of times ex.: String[] times = {"11:00", "12:00", "13:00"}; I want to take my current time and compare with the list which is the next hour, eg.: current time is 11:30, taken from the…
-
2
votes1
answer104
viewsClient side deleted object instance and sends to the server
I wonder if anyone has ever been through this problem and how did you solve it. I am using JSP and Spring Data JPA. I delete records from the middle of a form that’s a detail using Javascript,…
-
2
votes1
answer151
viewsVersioning . jar in Java with Netbeans
I wish that mine .jar had a version number and release date inside it, so I could inform it on the about screen for example. So far no mystery, but the point is that every build in Netbeans I wanted…
-
2
votes1
answer733
viewsHow to "delete" an image from the screen
In this code I would like to delete the image I put before and not one on top of the other. Graphics g = getGraphics(); Graphics bbg = backBuffer.getGraphics(); bbg.drawImage(fundo.getImage(), 0, 0,…
-
2
votes1
answer2863
viewsJava how to do a native query and return to a DTO list
I am using Spring Hibernate and am trying to make a native query with Join back to a DTO list. I tried using @Query(value="", nativeQuery=true) with a List but it returns the serialized attributes.…
-
2
votes2
answers952
viewsEnum as Hibernate Parameter Namedquery
Is there any way to pass as a parameter in a NamedQuery the value of Enum. public enum TipoConta{ CREDITO("Cartao de Credito"), DEBITO("Cartao de Debito"); private final String descricao;…
-
2
votes1
answer139
viewsManipulate onPostExecute from another Activity
I have both classes below: Dataload.java public class DataLoad extends Activity { SQLiteDatabase mDatabase; Session session; public static String jsonString = ""; @Override protected void…
-
2
votes1
answer103
viewsHow to pass to column of a Dynamicreports the contents of a compound object. Datasource is a list of this object
I’m making a report using Dynamicreports For this I am passing a list to be used as Datasource List<VisaoViagemQuadroMensal> linhas = new ArrayList<VisaoViagemQuadroMensal>(); where :…
-
2
votes1
answer713
viewsHow to set a new (external) source for a Jtextpane
I have a JTextPane and I want to define a new source (found on the internet) for it. I saw several tutorials, but none of them could define the source, I would like to make it as simple as possible.…
javaasked 9 years, 2 months ago Lucas Caresia 2,663 -
2
votes1
answer799
viewsError sending image to Imgur, how to resolve?
I’m trying to send an image to Imgur but it’s giving error, I can’t remember how to get the image. I’m using this code: public static String getImgurContent() throws Exception { URL url; url = new…
-
2
votes2
answers198
viewsListview infinity on android
I have an app that consumes a web service, only I have a generic call that searches all users and this taking a long time because I have several records, I want to do so the user goes down the…
-
2
votes2
answers634
viewsChange in audit in Java+Spring+Oracle application
I am tasked with changing an audit implementation in an application in which I work. The requirement of the audit is to know the history of changes, and execution of certain tasks by a given user.…
-
2
votes1
answer1026
viewsCentering text on a Jtextarea or Jtextpane
In this image the text is not centered, it is far above the JTextArea: And I would also like the text to begin in the middle of JTextArea and was adjusting as I was writing. What method can I use to…
-
2
votes1
answer310
viewsJava - Chat async
I want to implement a chat in java, which works asynchronously, and I wanted to know the best architecture to do this. I managed to make a public chat using sockets(Netty), but I got to the…
-
2
votes1
answer1430
viewsHow to add element inside an arrayList that is inside another Arraylist that in turn is inside a Hashmap?
The question is: I have the Classes Student, Discipline, Grade, Class. I need to add a double value in an Arraylist that is in an object of the Discipline class, but the Discipline class is inside…
-
2
votes1
answer124
views -
2
votes1
answer364
viewsInterceptor at Spring MVC
I made an Interceptor so that every time the system had a message to display trigger a javascript with the message. public class MessagesInterceptor extends HandlerInterceptorAdapter { public static…
-
2
votes1
answer1383
viewsLoad values from an already saved Selectitem into a database on the screen
I have a problem to load the selected value in <f:selectItem> by the user When render gets that way: <option value="320">Coordenador Desenvolvimento</option> I wanted the attribute…
-
2
votes1
answer177
viewsIdentify an Object property in Java+JPA and change it
I’m creating a class to get a database record and write to another database. I’m using JPA and bumped into a problem. I’m doing a generic insertion and I have to clean up the ID of the table to be…
-
2
votes2
answers308
viewsHow do I access an Arraylist of Fragments after a screen rotation?
I was trying to programmatically add to my Activity a list of Fragments that implement some Cardviews. These Cardviews have some Textviews that I would like to set from my Activity, and in fact, it…
-
2
votes1
answer6363
views -
2
votes1
answer1260
viewsHow to get a POST parameter in REST application
I started a Rest application and have a java class createPost POST @Path("/post/") @Produces(MediaType.APPLICATION_JSON) public static String createPost(@FormParam("loopID") String loopID) throws…
-
2
votes1
answer164
viewsManipulating two lists of a Drag and Drop component in different Managedbeans
I am using the Datatable Drag And Drop component. Contextualizing is as follows: I got a rap sheet based on footsteps. Where in the first step I enter the information of an Edict X, what is…