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
answers81
views'javax.persistence.Rollbackexception' received when invoking action listening '#{}
I inform the values on the page, but the values are not persisted in the bank. It’s like my page doesn’t send the values to the controller classes. If the values are reported however, the error is…
-
1
votes0
answers36
views -
1
votes3
answers982
viewsHow to verify encrypted passwords with user input passwords in the database?
I am creating a program in which the user will put the login and password before entering the system,and after he put his input,the passwords will be saved in the database,and then I will check if…
-
1
votes0
answers29
viewsSubreport with iReport in Java - The supplied java.sql.Connection Object is null
Hello! I’m studying iReport Design and started using Connection in my fillReport. So far, everything was fine. The problem is that, now, I started to use Collection, through the commands:…
-
1
votes1
answer62
viewsBecause "my program" did not increase the value 5 being that it less than 5.5
I’m starting in programming and always trying to figure out the things that are not clear, so far I managed, but this one I tried and tried and I can not understand why the program did not increase…
javaasked 8 years, 5 months ago Eduardo D. Oliveira 67 -
1
votes0
answers423
viewsRead Java File with delimiter
I have the following txt file: 38461;Rui Brito;20 34561;Rui Brito;10 31231;Rui Brito;6 And the following code: ArrayList<Aluno> listaAlunos = new ArrayList<Aluno>(); public void…
-
1
votes1
answer574
viewsHelp with scrambled words
I need help in a program, I have no idea how to do, the statement is as follows: "Scrambled Word - Implement a program that, from a word bank, randomly selects a word, shuffles the letters and gives…
-
1
votes1
answer177
viewsHow can I check if a variable has been declared (desenv. of a compiler in Java)
I’m having trouble implementing a demonstration of a semantic analysis of the desenv. of a compiler in Java. I have a Jtextarea and put. ex type: int x; x = 'a', it must be an error since x is an…
-
1
votes1
answer544
viewsHow to call a class through another class using Jmenuitem?
I have two classes in the same package, one called Calc, which is a simple calculator, whose code is below: public Calc(){ super("Calculadora"); Container tela = getContentPane(); setLayout(null);…
-
1
votes0
answers125
viewsI need to take the data from the browser url and pass this data to an application
I have a java web start application. And I need to make the browser pass the parameters to that application. The javascript function is taking the data from the url but is not yet passing to the…
-
1
votes2
answers634
viewsSort objects according to name attribute using Collections.Sort() or Reverse()
How to sort objects through the name attribute? I am implementing the Comparator interface. I made a small example. Let’s go to the codes: file: Person.java import java.util.ArrayList; import…
javaasked 8 years, 5 months ago André Nascimento 1,258 -
1
votes1
answer198
viewsWhich string library can I use?
I’m refactoring a code that uses the eclipse plug but I want to turn it into pure java. The idea is to transform String into something with this style: Person@182f0db [ name=John Doe age=33…
-
1
votes0
answers87
viewsConnections in web application
I am creating a J2EE, jsf project. They have multiple Beans and controller, and the Beans access the Database. I’m having doubts how to manage the Connection for the database, right now I only have…
-
1
votes1
answer30
viewsProblem in rendering
In my registration screen I have 2 buttons: Save and Come back. In case I am editing some record, the button is enabled New. My problem is when I click this button New the screen gives the refresh…
-
1
votes0
answers44
viewsAdd scroll bar to select in webbrowser
I need to change the properties of my webbrowser in javafx so that a scrollbar is available in select. By default the HTMLSelectElement is adding 2 arrows one at the beginning of the list and…
-
1
votes1
answer507
viewsCriteria to filter a string array list
I have a relationship n:n amid AgendaTriados and Indicacao thus forming the triados_indicacao. Saved in the database a array of string of the names of the indications. I want to do a survey using…
-
1
votes1
answer198
viewsHow to put title in Jdesktoppane?
I am developing software for a video rental company with Pattern MVC (Model-view-controller) design with the Java Persistent Api Framework and XML language. My question is this: How do you put and…
-
1
votes0
answers422
viewsRemove blanks from a string and join it
I have a string of a Logical Expression Ex: ((T ∨ F → T) ∧ (T → F)) → (∼F → T) I need to remove the blanks from the string and join them as a result: ((T∨F→T)∧(T→F))→(∼F→T) How can I do this in…
-
1
votes1
answer281
viewsDelete created entity from a Manytomany relation
I have a relationship ManyToMany amid users and profiles mapped with Hibernate: user: id name profile: id profile_name user_profile: user_id profile_id The mapping is done as follows: User:…
-
1
votes1
answer49
viewsCheck if the string contains other characters
I am developing a project that works with logical expressions, for example receive as input: ((TvF->T)^(T->F))->(~F<->T) then I do all the validation to remove blanks, replace ->…
javaasked 6 years, 8 months ago Gabriel Longatti 559 -
1
votes3
answers462
viewsHow to limit a user to only access their own data?
I am developing a task list application for study, however, all users access all tasks. I wonder if anyone has ever implemented something like this with the Spring Security and how you did.…
-
1
votes1
answer355
viewsProblems getting value from Resultset
I’m trying to get the values of a select in the derby but they just returns correctly a field from Resulteset. Follow DB access class code: import java.sql.Connection; import java.sql.DriverManager;…
-
1
votes2
answers681
viewsHow to record a txt file with each patient’s name?
I’m developing a college project which is a clinic system where the receptionist makes the patient’s registration and other more options. I’m trying to get the employee to register a new patient,…
-
1
votes1
answer1203
viewsWELD-001408: Unsatisfied dependencies for type Servicelocator with Qualifiers @Default
I’ve been trying for a while to implement a JAX-RS (Jersey) server with Datasource, already migrated from Tomcat to Glassfish, and now from Glassfish to Wildfly 11, but I’m having the error below…
-
1
votes1
answer58
viewsException in Thread "Main" java.land.Nullpointerexception com.Login.Login.mai(Login.java:18)
Today I tried to make a login system (again), only this time I used a array one-dimensional to guard my values. When I ran my program, Eclipse had an error (null pointer to be more specific), my…
-
1
votes1
answer143
viewsConnect server to local network by hostname
I am trying to connect to a local network server using the hostname (can not use IP because the client network does not allow to put fixed ip and the equipment does not have IP reservation for MAC).…
-
1
votes1
answer393
viewsJbutton how to get the Text from the Button inside event
Hello I need to create n Jbuttons, the creation criterion is a table in the database that has n items. I have to create a button for each item and when I click the button it has to show me a message…
-
1
votes1
answer66
viewsDoubt regarding dimensioning methods in a Frame
What is the difference between the method setSize() and the method setPrefferedSize() in a Frame, and in which situation each one should be used?
-
1
votes0
answers1120
viewsSave a csv file
I am trying to save a csv file with 2 table data, so I did it as follows: Writing method: public void escrever(int PedLinhas, int ProLinhas) { File caminho = new…
-
1
votes0
answers63
viewsSimple error trying to use Hibernate + JPA
Good morning, I’m starting to create a simple register with Hibernate. I have the following classes Java link. http://pastebin.com/vgDn9U3Y Hibernate.cfg.xml http://pastebin.com/06kA87Lv Form action…
-
1
votes1
answer331
viewsImplementation of Containerrequestfilter with Jersey
I’m doing the token implementation through this tutorial, but when I try to implement Containerrequestfilter the program sends the error below. The error occurs only with the implementation of the…
-
1
votes1
answer73
viewsChronometer display value greater than 60 minutes in MM:SS format
Hello, there is the possibility of a Chronometer displaying more than 60 minutes without entering the hour format? My Chronometer receives data from a String to set the starting value. private long…
-
1
votes2
answers378
viewsHow to put simple apostrophes and concatenate with a string?
I have a question, I want to be able to concatenate a String, so that it is interpreted with simple apostrophes between it. For example, SQL would look like this: SELECT IDALUNO, NOME,…
-
1
votes1
answer1994
viewsUpload and files using Rest API
I am creating an end-point to upload a file in the format (.txt) but my entity does not consist only of the file. There are other attributes, so I need to send a json this way to the server : {…
-
1
votes0
answers234
viewsSpring Boot + Hibernate + Google Cloud Sql + App Engine
I’m having problems configuring the connection in my application with Google Cloud Sql (using the technologies highlighted in the title). I wish I could allow Spring to be responsible for…
-
1
votes0
answers69
viewsCardview And Horizontalscrollview
How to do for all cards are the same height as scroll horizontally? Fragment: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"…
-
1
votes1
answer163
viewsValidate a text with regex
I have the following code: final String msgRegex = "Produto [a-Z0-9À-ú, ]*"; final String msg = "Produto Soja"; if (msg.equals(msgRegex)) { System.out.println("Verdadeiro"); } else {…
-
1
votes1
answer115
viewsHow to package a Spring Boot application with Maven without running the tests?
I am developing an application with Spring Boot and every time I perform the command mvn package He runs my unit tests. However, my tests do not raise the server with the application to run the…
-
1
votes0
answers52
viewsAre multiple JDBC connections "thread-safe"?
I am creating a very simple java and postgresql project of clients and contacts between clients. Exists the table clientes with id and name, and the table contatos with id1 and id2 which refer to…
-
1
votes1
answer230
viewsStore input values in Java
I need to store values with more than one entry. If a program requests 10 entries, should I store them in 10 variables? In this case the entries are of the type Int.
-
1
votes2
answers248
viewsCall method by class or by instance?
What would be the most correct way to call a method of another class? It is more correct to create the object: private MinhaClasse minhaclasse; minhaclasse = new MinhaClasse(); To then call a…
-
1
votes1
answer144
viewsHibernate Error Persist
I have a simple system of opening / calling query. I am in error when trying to insert a new call. I started using Hibernate and I have a problem with "persist" to add a call to a certain call…
-
1
votes1
answer60
viewsHow to treat json in java
I’m trying to treat the following json: [{"code":"ARS","codein":"BRL","name":"Peso Argentino…
-
1
votes1
answer32
viewsImageviewpageadapter cannot be Applied error
Can anyone help me with this error? It occurs when executing a setarView method. Follow the code: package ufc.es.com.br.doesempre.modelo; import android.app.Fragment; import android.os.Bundle;…
-
1
votes0
answers14
views(Struts2 - JEE) I used extends of an action class and in the class call my execute() does not run
So guys, I never had a problem with running the project’s action classes, but this time I wanted to reuse code from another class and when using extends in the call, it just runs prepare() and…
-
1
votes1
answer302
viewsAttribute declaration in a Java class
Why the statements of these variables were made like this? public class Jogo { private Tabuleiro tabuleiro; <<- private int rodada=1, vez=1; private Jogador jogador1; <<- private Jogador…
-
1
votes2
answers2017
viewsText View Null: void android.widget.Textview.setText(java.lang.Charsequence)' on a null Object Reference
I’m taking a data from an API on a fragment to change the txt of Activity. But when I call the function that makes this change the setText gives NullPointerException. If I call the same function on…
-
1
votes1
answer442
viewsError in calculator created in android studio
I started doing some things with android studio. The error you are giving is in a simple calculator that does not do the correct operations, example: 1+2=1,1+8=1, and others that keep giving 0. I…
-
1
votes2
answers343
viewsClick Checkbox component and enable Edittext
How to enable an edittext component in the same view by clicking on the "other" checkbox component? As in the image:…
-
1
votes1
answer489
views