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
-
0
votes1
answer341
viewsiReport lacks special character when exporting PDF
I’m using iReport 3.7.4 to generate the reports. In one of the reports, I need to use an arrow, to indicate a step by step. So I found the arrow code in Html Entities &# 10140;, and in the…
-
0
votes1
answer451
viewsJAVA Query with ACCESS - Slowness
I need to access the ACCESS database, the query is accessing correctly, but I noticed that to have the return of information, the JAVA first reads and all the tables and all the data, is that right?…
-
0
votes1
answer158
viewsError when trying to edit a record: component<p:selectManyCheckbox/> failed to lazily initialize a Collection of role:
Hello personal I have no experience with java and would like to receive help. I’m mapping SEVERAL lists with @Manytomany(Scade = Cascadetype.ALL) and I’m getting the following excpetion when I try…
-
0
votes1
answer75
viewsEquivalent to LEFT() sql function in JPA
What is the LEFT() equivalent function in JPA? I need to take only the first 6 characters of a field. The equivalent select in sql would be: select left(campo,6), count(*) qtd from tabela group by…
-
0
votes0
answers102
viewsproblems with web service Jquery + Vraptor 4 "status of 404"
I know it says it wasn’t found, but I can’t find where I went wrong. My controller: @Controller public class ProdutoController { @Inject private Result result; @Path("/") public…
-
0
votes1
answer77
viewsUse Case in Tool Case
how we should create the use case diagrams, make a diagram encompassing all use cases or make several diagrams for each specific scenario. Ex.: I have within the system several lines of work, part…
-
0
votes1
answer290
viewsWork with Date in Mysql, JPA
I’m using JPA and creating an entity to store one date within the database. So far so good, the problem is that I need to display the database information according to the month of my date. Do you…
-
0
votes1
answer631
viewsTabpane: How to change Tab by clicking the Javafx button
I don’t know if I’m in the right place but go anyway, guys I started learning Javafx a little while ago and have a doubt, I was wondering how I can change Tab when I click the example button: I have…
-
0
votes1
answer39
viewsBack to another dialogAlert
I have a process capture system on Android in which when detected something suspicious, it emits an alert window with some options. I would like to know how I do for when I open any of these…
-
0
votes1
answer44
viewsType problem with Projectionlist in criteria
I’m having a problem in java giving the following error: in class: com.app.myApp.ReportDTO, setter method of property: indicator expected type: java.lang.Double, actual value:…
-
0
votes1
answer89
viewsHow do I disable the third and fourth Edittext if the first is not filled in?
I have three Edittext and need to check if the first Edittext is empty and if the second Edittext is also empty. If Yes I must disable the third Edittext. How can I do that?
-
0
votes2
answers374
viewsWhy am I getting the error : android.content.res.Resources$Notfoundexception: Resource ID #0x0
Can anyone explain to me what the mistake is in this code? I honestly don’t understand why I’m getting this mistake ! Java : public class Chose_curso extends AppCompatActivity { private TextView…
-
0
votes0
answers36
viewsHow to let app run on 2° plan?
I have an Activity and I want it running at 2°; plan, permanent time, I know it will waste Cellular battery but I need help . The code I have to implement is a webView this : new…
-
0
votes1
answer270
viewsHow to use Junit with Demoiselle 2.4.2?
Hello I have a project with the following profile: Eclipse Luna Java 6 JSF 2.2/Primefaces 5.3 Jboss 7 Demoiselle 2.4.2. The application already works, the problem is in the execution of test cases…
-
0
votes1
answer805
viewsAndroid Studio Screen - Block Completely Touch
My question is the following, I have an Activity that finalizes an order and inserts the data of that request in the database and it takes a little time.... I wonder if there is any way to lock the…
-
0
votes2
answers219
viewsDatatable with jsf
I’m having some difficulty using the datatable of the primefaces together with jsf, I tried to implement it in a certain way: <p:tabView> <p:tab title="Alterar Usuarios"> <h:form…
-
0
votes1
answer930
viewsHow to resolve "Type Mismatch: cannot Convert from element type Object to Message"?
I was studying JSF and found this site where teaches to create a basic chat using JSF, primefaces and ajax: https://jetcracker.wordpress.com/2012/03/04/jsf-how-to-create-a-chat-with-ajax/ I have the…
-
0
votes1
answer141
viewsHow to cancel Edittext enter?
I wish the keyboard didn’t happen when the user touched enter. How can I do that?
-
0
votes1
answer67
views"Changing" from Jframe to Jintertalframe
I developed the first version of my entire project using Jframes, but in the upgrade I’m doing I decided to change all to one JInternalFrame. I looked through the internet and saw that it was…
-
0
votes1
answer68
viewsRunning Java Webservice out of eclipse with Maven
Hello, I have a webservice project that runs normally on my computer, using the eclipse and Tomcat. And now I want to transport this project to a server and have it run only with Tomcat. There also…
-
0
votes1
answer955
viewsHow to get the value of an input with getParameter?
I’m not getting the value of the following input. <input type="text" name="rua" class="form-control" id="rua" placeholder="Rua/Av/Estrada" disabled required> This field it is filled through a…
-
0
votes1
answer728
viewsOpen Jasper Reports report on Web Server
I cannot open my reports on the Web Server, after deploy. My project is java Hibernate with Maven. When I try to print a report I get this log from Tomcat: Log of the Tomcat 19-Aug-2017 20:35:32.050…
-
0
votes0
answers174
viewsDoubt when generating REST of return of Procedure in jersey
I have a method where his return is a list, based on an execution of a trial in the bank StoredProcedureQuery spq = em.createStoredProcedureQuery("PROCEDURE"); .... The return of this query are some…
-
0
votes0
answers178
viewsHow do I capture data from a stream (Song name, album cover, band name)?
How could I capture the metadata of an audio stream and put some data as the album cover, song name, and display it on my Activity.
-
0
votes1
answer252
viewsCreating a Method to Replace Characters in a String
Can someone help me create a method that replaces the Characters of a String? For example, String nova = antiga.replace('a','1'); This only replaces a letter. I wanted to create a method for all…
javaasked 7 years, 1 month ago Eduardo Brito 59 -
0
votes2
answers2013
views -
0
votes0
answers140
viewsHow to use Jobscheduler?
I’m with a project to make my Activity wake up every 12 hours and couldn’t find code that sure about Jobscheduler, someone can help me with the code ?
-
0
votes1
answer40
viewsQuery Logical Hibernate
public boolean minimoUmSuperUsuario(Usuario usuario, Session sessionExterna) throws HibernateException { Criteria crit = sessionExterna.createCriteria(Usuario.class); return (Long)…
-
0
votes0
answers80
viewsSubistituir Requestcontext by Facescontext
I currently use the following functions which are from Primefaces: RequestContext.getCurrentInstance().update("ComponentTal") RequestContext.getCurrentInstance().execute("FuncaoJavaScript") How can…
-
0
votes2
answers57
viewsActivity giving crash
When I start Activity "Data" the screen turns white the program gives a crash, but if I comment all the programming of the same the program does not crash, but the screen is blank and what is in the…
-
0
votes0
answers34
viewsHow to use Salt correctly with MD5
I’m using Apache Commons Codec to encrypt system users' passwords. Ex: DigestUtils.md5Hex(usuario.getSenha()) The problem is that depending on the password it can be easily broken, so I thought to…
-
0
votes2
answers510
viewsVector Comparison Problem - Java
I have a problem with a simple code in Java, I just started learning the language. The exercise consists of comparing the values of the vector to see if there are repeated elements. The problem is,…
-
0
votes1
answer189
viewsSocket with UTF-8
I’m doing a chat that will run on network (internal), I’m just not able to make work the issue of accents and "ç". It works by running in the IDE but if I have . jar and run (on any PC) it does not…
-
0
votes0
answers362
viewsHow to change the default size of an icon?
Is there any way to change the default size of a javafx application icon? I have an image that I intend to use as an application icon, but it turns out to be too small both in the upper left corner…
-
0
votes0
answers752
viewsConnection error between Java and postgresql
I’m trying to make a graphical Java interface connect with a database, so I’m using Netbenas and Postegresql. I created a table in Postegresql. I downloaded the postgresql-9.4.1208.jre6. jar and…
-
0
votes1
answer219
viewsConvert day of week number to Day string
I need to convert the number that corresponds to the day of the week in String of the day in Java. Ex: 0 => Monday 1 => Tuesday
javaasked 7 years, 1 month ago Mateus Carvalho 1,494 -
0
votes0
answers314
viewsDoes Build Spring Boot take long to compile?
I am doing an example using Java with Spring, I am using Intellij IDEA, it takes a long time to compile, I am using Tomcat, show a lot of message on the server, have how to configure to be faster?…
-
0
votes1
answer587
viewsHow to concatenate 2 Strings with Java in HTML
I am using the following input with 2 pre-set values. <input type="text" class="read-only" value="${FORM.dataAgendamento + FORM.horaAgendamento}" readonly="readonly" size="40"/> If they are…
-
0
votes0
answers360
viewsbarcode in android printer Bluetooh
I can print anything but the barcode I currently use: byte[] cmd = new byte[3]; cmd[0] = 0x1b; cmd[1] = 0x21; cmd[2] &= 0xEF; out.write(cmd); out.write("Mensagem de teste \n".getBytes()); The…
-
0
votes0
answers255
viewsJSP does not display images or find CSS and Javascript
Good night, I’m having a weird problem, I’m trying to display images, map CSS and JS in jsp and it’s not working, it just doesn’t, the weirdest thing is that I’m using the c:url tag of "jstl/core"…
-
0
votes0
answers104
viewsFailed to update to registry
I am having the following problem, when I try to change a registry made by my application, it creates a new record instead of changing. My question is, if when I do the trigger of insertion of the…
-
0
votes1
answer235
viewsConvert string to timestamp for java date
How to convert string to timestamp generated by php with the time() method generated for example : 1504541885 for Date in java
javaasked 7 years, 1 month ago Paulo Rogerio 307 -
0
votes0
answers47
viewsMethod giving error when returning value
I’m making the following mistake: cannot find simbol. He gives in the method Return, I checked my code and could not locate anything wrong. Follow the code below: public ArrayList<String>…
-
0
votes1
answer956
viewsEclipse Debug Settings
Good afternoon. I’m having a problem debugging my project on Eclipse. Native java classes are appearing in the debugging process when the only classes that are interesting to me are the ones that…
-
0
votes2
answers559
viewsAlgorithm that reads three numbers and displays the result of the sum of the first two and multiplied by the third
Follow my code below, however does not return correct the result, if I put as input 2, 2, 3 was to appear 12, but appears 6 public class Exercicio2 { @SuppressWarnings("unused") public static void…
-
0
votes0
answers537
viewsAuto search (Auto complete search)
Good afternoon! I am trying to implement an auto complete search on my system. But so far I have not achieved a satisfactory result. What I want is when the user searches shows the result, as google…
-
0
votes0
answers107
viewsServlet to add Contacts in mysql does not work
I have an html uploading request for a servlet which answers with error but when I have a class rotated testaAdicionaContato. mysql 5 table: create table contatos ( id BIGINT NOT NULL…
-
0
votes0
answers41
viewsDirectory monitoring stops the system from responding to interactions
I have an application that monitors a certain folder and checks if there is the creation of a new file if a new file is created triggering several processes on the system. But when active monitoring…
-
0
votes1
answer33
viewsI need help with replaceAll for monetary values!
String sal = "1500,32"; double salario = 0; sal.replaceAll( ",", "."); salario = Double.parseDouble(sal); Can anyone explain to me better the replaceAll? is giving error!…
javaasked 7 years, 1 month ago Joel Medeiros 21 -
0
votes0
answers62
viewsHow to put the Accelerometer method in my app
I’m creating a Java app with my friend, and I wanted to put an image with an accelerometer that moves around the screen avoiding obstacles, but I’m having a problem the video I saw (only one I…