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
answer358
viewsButton does not appear in window
My button called btnLimpar does not appear. that’s the code: import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class Frame…
-
1
votes0
answers34
viewsHow to Do REST Security with Spring Security
People I am trying to implement security on my REST server done with SPRING 4. I am working with annotations. The basics of spring security to protect pages I know. But how to protect the…
-
1
votes2
answers336
viewsInstantiate an external Java directory class in JSP
I created my app Java with Eclipse in the directory Meus Documentos/workspace/TesteJAVA/ Now I want to call a class with JSP, want to know how to configure to grab the application from this…
-
1
votes1
answer170
viewsPass txt to xml in java
Hello, I have a problem in a txt file, I need to pass ordered to xml, however this txt file is ordered in a very strange way. Nº Estado Civil Grau de instrução Nº de filhos Sálario Idade anos meses…
-
1
votes0
answers533
viewsProblem with Tomcat sessions
I would like to know the following staff, a company application presents a high number of sessions in the manager of Tomcat. The system has been rising in the number of users and would like to know…
-
1
votes0
answers99
views"Outofmemoryerror" error using Volley
I’m making an application where I have a URL that returns a JSON, through the Volley library, I’m taking the content of this URL and turning into string, this process shall be carried out on each 5…
-
1
votes2
answers281
viewsReturn to start if size is not reached
Guys, I got this week a really fucked-up college job and I’m having a problem with a part of it... The thing is, I have to set up a system for a bracelet store, which gives the choice of size and…
-
1
votes1
answer801
viewsJtable does not display column names
I made a Jdialog that will show some statistics of the users who use the software, but I’m not able to make the columns name appear. I tried to add using the .addColumn model but not working. class…
-
1
votes2
answers339
viewsIncomplete entity class problem - JPA
Personal I am trying to make the relationship between two class (Cotdetatlhe and Cotdetforn), but I am facing the following problem: The @Joincolumns on the annotated element [field cotDetatlhe]…
-
1
votes2
answers140
viewsAND operators and OR
I recently started using the Criteria API because I need to make queries that would be very complex with HQL. How I use the operators AND and OR in queries with Criteria API?…
-
1
votes1
answer228
viewsSugar ORM ANDROID
Good morning Is there any way to change tables and fields in the Sugar ORM database, so that when performing the app update, it does not lock? I have a register and I own the PRODUCTS table and it…
-
1
votes0
answers401
viewsSend msg by Whatsapp to directly by an application
It is possible to send a message via Whatsapp to a pre determined contact directly from my application. Without opening the application and having to select the contact and then send the message.…
-
1
votes1
answer203
viewsHow to open a Dialog without darkening the Android background screen
I have an Activity, and in this one I call a Dialog, but when I open this 'popup' the background Activity screen that called it darkens, but I wish that didn’t happen. You can do it?
-
1
votes3
answers182
viewsHow to instantiate an Activity with Edittext fields without being automatically selected?
Developing an Android application, I came across a problem, I have an Activity where there are editing fields (Edittext) in xml, and when I instate it, the first Edittext field, is selected and the…
-
1
votes0
answers443
views -
1
votes1
answer378
viewsParse HTML with Jsoup - Java
I am studying Jsoup library and I took the most basic example of the site and tried to build something simple, but I have this error, which does not allow me to execute the code: Default constructor…
-
1
votes1
answer1505
viewsHow to run multiple threads sequentially?
I have to run a thread x and let the thread y start only when x is done, regardless of how long it will take, and then run z only when y is done. Does anyone know the best way to do this? Thanks in…
-
1
votes1
answer2389
viewsView PDF on android
I need to insert a pdf into my application; how could I do that ? Is there a pdf view? The pdf will be inside the application itself in the Assets folder. Thank you.
-
1
votes2
answers726
viewsHow to use Hashmap in this case?
I’m a beginner in Java. I need a program that reads the name and number of some people and then type a number and the program returns the name of the person associated with the number. I was…
-
1
votes1
answer438
viewsNull object fields when trying to persist with JSF and JPA
I am trying to persist an entity and when I try to persist it plays an error of Constraint Violation, performing the debug, I noticed that the object is instantiated but the fields are null.…
-
1
votes1
answer67
viewsDownload tagged <a> in webview
Hello! I have a webview working, I’m trying to create the following html tag: for(int i = 0; i < nm.size(); i++) { html.append("<a…
-
1
votes1
answer361
viewsJava Web Authentication Control
Good evening, I’m doing a project using JSF, Hibernate and Tomcat and one of the requirements is: X RF 01. The system must use access passwords for secure application control. What could I use in…
-
1
votes3
answers173
viewsAre there any techniques to apply maintenance in the code?
Besides applying high cohesion and low coupling, how to handle codes like this? They may even be legible but this excess of logical operators, I do not see it possible to refactor even with…
-
1
votes2
answers1298
viewsHow to integrate Spark Theme - primefaces with Maven
Can anyone help me with my problem? I’m trying to integrate Spark Theme with Maven to move up the theme. Meanwhile, I’m having a hard time. http://www.primefaces.org/spark/ I looked at the…
-
1
votes2
answers201
viewsWhy does Tree not come with a value, but with the name of the object in memory?
Error image Managed Bean package com.algaworks.erp.controller; import java.io.Serializable; import java.util.List; import javax.faces.view.ViewScoped; import javax.inject.Inject; import…
-
1
votes0
answers204
viewsjava.lang.Noclassdeffounderror: gnu/io/Serialporteventlistener communication with Rduíno
I’m trying to make a java communication with an Afghani but I’m having a problem when I invoke a Class that implements the SerialPortEventListener on my controller. Controllers This Java class is…
-
1
votes1
answer24
viewsIs it possible to use Tiles within Springmvc tags?
Hello, I am creating a generic form so that I can parameterize some attributes. I want to do the following : <sf:form cssClass="form" modelAttribute="<tiles:getAsString…
-
1
votes2
answers1044
viewsHow to invert the values of the main diagonal of a 5x5 matrix?
Input example: 1 3 6 8 7 3 7 8 0 3 2 4 3 6 7 8 9 1 3 5 5 6 7 8 5 Output example: 5 3 6 8 7 3 3 8 9 3 2 4 3 6 7 8 0 1 7 5 5 6 7 8 1 I have so far this: BufferedReader in = new BufferedReader(new…
-
1
votes1
answer367
viewsHow do I choose the right scope for a bean?
From what I’ve been studying, I know there are several scopes for Beans: @RequestScoped @ViewScoped @FlowScoped @SessionScoped @ApplicationScoped What is the function of each? How should I correctly…
-
1
votes1
answer315
viewsClose Activity after result
I’m trying to implement a tutorial using Zxing to read Qrcode. In the tutorial who was accompanying him uses the Eclipse and places the libs of Zxing all importing "by hand". I am using Android…
-
1
votes4
answers9178
viewsRegex to pick a text between <>
I’m trying to pick a word between <>. For example: Text: "Joao <[email protected]>" My regex should take [email protected], but it’s catching <[email protected]> The regex I’m using is…
-
1
votes0
answers125
viewsError calling Webservice that returns a list (JPA)
Hello, I am unable to return a list of orders by Webservice: public List<Pedido> getPedido() throws Exception { String query = "SELECT p FROM Pedido p"; TypedQuery<Pedido> typedQuery =…
-
1
votes0
answers28
viewsJersey API Cache
I’m having second thoughts about Jersey Cache control. Using Queryparam, is there a risk that the browser/server will cache the result? Or this only happens when I work with Pathparam within my GET…
-
1
votes2
answers1154
viewsHow can I order a Linkedlist?
So like I said in the title I need to order a LinkedList of an object and these objects as a sort parameter. Follows the code: public LinkedList getOrderOfActivityCompletion() {…
-
1
votes1
answer238
viewsUpdate an h:outputText from a p:autocomplete database
I have a medical care application and I have the following question: when to use the component p:autoComplete of Primefaces to search for the name of the patient who has the attribute…
-
1
votes1
answer406
viewsmethod that checks if there is any record in my database
Good morning guys. I’m new to Java programming, and I’d like a little help. Well, the thing is, I want to do a method and check if there is any record in my table, if you have, proceed with the…
-
1
votes0
answers90
viewsClassnotfoundexception error in Recyclerview$Savedstate
When I go a while without touching the app and go back to it, it makes that mistake: E/Parcel: Class not found when unmarshalling: android.support.v7.widget.RecyclerView$SavedState, e:…
-
1
votes1
answer129
viewsHelp with Arraylist
Only the last two elements of my Arraylist are sent as datasource in ireport. I have an Arraylist that stores read tag data in xml files. For example, I select three xml files with the same tags but…
-
1
votes1
answer53
viewsChange icon mylocation
I created an xml with an Imageview informing the image I want to put in place of the icon. I want to put this image in place of the blue ball of the image below. Is it possible to change the…
-
1
votes1
answer74
viewsWhat is the name of this component below?
Have some component ready with primefaces do what the image illustrates below? I need to do this with JSF and I’m half lost. The idea is that yes is an auto complete, but if he does not find…
-
1
votes2
answers679
viewsJava generate JSON from a string
I’m a beginner in programming and I’ve never worked with json I’m doing a work on graphs and to make the graphical representation of the graph I need to generate a json with the graph data, I made a…
-
1
votes1
answer92
viewsperform 2 methods that require audio reception
I got a problem here. I have 2 methods, one of them shows the sound waves ie (you activate it and what you speak it interprets in lines), the other when it is activated it records what the person…
-
1
votes1
answer1525
viewsUpdate (refresh) a Jdialog (swing) dynamically
I’m having some problems updating the JDialog created through the WindowsBuilder no Eclipse (would not be on account of this). Basically I have a screen Change Registrations of my financial…
-
1
votes1
answer62
viewsClasspath of my shell script failed to find a particular jar
I have a shell script that executes the following instructions: #!/bin/bash java -Dcom.sun.management.jmxremote -classpath .:lib/* br.com.governa.admin.sincronizador.negocio.Sincronizador…
-
1
votes1
answer133
viewsToolbar Android
Guys, I wish I could take off the <- arrow back from the Toolbar. Could someone tell me?…
-
1
votes1
answer551
viewsHow to know which version of JSP is in a project
I have a project Java and would like to know what version of JSP that is being used in this project. Example, I have an old project, how can I get this information?
-
1
votes1
answer52
viewsFailure in swing application response
I have a swing application in which verifying whether the typed word is correct or wrong. String palavra[] = new String[3]; palavra[0] = "bar"; palavra[1] = "ola"; palavra[2] = "alo"; String p =…
-
1
votes0
answers68
viewsJava app application
This code when pressed on button definicoes, opens a new window with an image, a line with text and also generates radio Buttons, but the problem is that it creates another new window with radio…
-
1
votes0
answers448
viewsProblems printing barcode on EPSON LX-300 II printer
I’m trying to print a barcode on the EPSON LX-300 II printer, but it’s not working. I’m using the following command: (Esc char)(B0500001800000000011151113939183000157550000000000091111023116 Which…
javaasked 9 years ago Joaquim Magalhães 169 -
1
votes1
answer1944
viewsError 505 when installing Google Play App on Lollipop
I’m a developer and I’m having trouble installing an app in the Lollipop version. I did some research and I believe it’s a duplicity error Packages, ie have two Apps calling the same package (but…