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
answers97
viewsPerform Hibernate mapping (Annotations) of foreign key being also the primary
I want to carry out the mapping in the standard Hibernate Annotations of my class, being the one-to-one relationship between the tables, and the primary key of one is foreign and primary in the…
-
1
votes1
answer1191
viewsDynamically Create Jlabels
I have to create, from a click of a button, a JLabel dynamically. So that these honeys are organized in an order, assigning a name to that JLabel. The user can create as many Abels as he wants...…
-
1
votes1
answer85
viewsSave output after applying an replace
Hello, I have the following code below, but I need to apply a replace in the output(FileOutputStream) picked up via http before saving him. public void DownloadFile(String fileURL, String fileName)…
-
1
votes1
answer37
viewsFormat a string matcher found
I’m using matcher to pick up different time patterns but when writing the same I would like it to be written in the correct format, I tried to use Simpledateformat ("HH:mm:ss"), but it didn’t work.…
-
1
votes0
answers29
viewsTomcat: What is the criterion for the "Thread" column to appear on the "Connectors" page of the Probe?
Hello, I would like to know what should be done so that the "Thread" column appears on the screen "Connectors" of the obe, this column appears normally in my installation of Tomcat 6.0 + Probe…
-
1
votes1
answer1006
viewsUse Java Project in another project
I have a web java project (a kind of framework) and I want to use it in my main project(the application), but I don’t want to generate a .jar. I want to use it directly within my project so that…
javaasked 8 years, 4 months ago Jeterson Miranda Gomes 672 -
1
votes1
answer249
viewsWhat is Prevayler for?
I’m studying Prevayler in college, but I do not know the real use, or why to use, looking on the Internet I found several discussions but nothing that really explain what it is for. Would it be to…
-
1
votes1
answer199
viewsCreating columns in tables through variables in java
Hello, I would like the help to solve the following problem: I have a table, but its columns can be defined by user-defined variables. For example, the user defines a1, B1 and C1, from which the…
-
1
votes1
answer71
viewsstring comparison + linkedList
Good evening, I am trying to compare a string with a Linked list but I am not having success, the Linked list is being returned a value of another function but I will put here the output of the…
-
1
votes3
answers6122
viewsWhere can I find the Windowbuilder package for download/installation in the Eclipse IDE?
I need to create applications with a Java graphical interface. I use Eclipse Mars as an IDE for programming in Java, I noticed that it does not have in its standard installation the Windowbuilder…
-
1
votes1
answer37
viewsJava Android - Save Events
How do I save events to an Android Java APP? for example, a program has a checkbox, I open it and leave, when it returns it will be unchecked.How do I make the information that she is checking is…
-
1
votes2
answers174
viewsMethod does not correctly show expected result
I have this interface public interface Promocional { boolean aplicaDesconto(double porcentagem); default boolean aplicaDescontoDe10Porcento() { return aplicaDesconto(0.1); } } The class LivroFisico…
-
1
votes0
answers25
viewsRectangle2d is not upgrading according to mouse X and Y
Hello, I’m a beginner in Java, and I’m having problems with my code. My goal with it is that you can draw just by dragging the mouse. The measurements are disproportionate and I’m using a rectangle…
javaasked 9 years, 3 months ago Carlos Manuel 73 -
1
votes0
answers15
viewsOutOfMemoryError x loadAd(adRequest) x AdActivity
Good night. Someone knows the class AdActivity? And does anyone know if I can use it without a problem finish()? Context acontext = null; AdActivity adActivity = (AdActivity) acontext;…
-
1
votes0
answers55
viewsHow do I list the images on a XHTML page
Greeting to all, is the first time that I am implementing a list of images on an XHTML page, my project is a news registration, and is using the upload approach recording the image path in the bank…
-
1
votes1
answer124
viewsSocket Doesn’t Send Message to Right Customers
When typed /msg nome mensagem should send this message to nome, but he sends it to whoever typed it Java manager. private Socket cliente; public static String nomeCliente; private static…
-
1
votes1
answer960
viewsHow to sort an array of objects in java
Hello, I have a class teams where they have scores (int), winning number (int), defeats (int) etc. Within the method main, I have an array of 20 teams and need to sort them by the score, if the…
-
1
votes1
answer1071
viewsMinimize application to system tray
I made an application as requested by a client, but at the end of the project he informed me that the application should open in Tray Icon, and when minimized continue running in Tray My application…
-
1
votes1
answer1269
viewsWhat is the Lombok?
What is the Lombok and how I could use it in a java class? What are the advantages and disadvantages of handling in a java application?
-
1
votes2
answers106
viewsHibernate: Increment from a specific value
I created an attribute like Integer called registration and want that, when the user is to register, the value of this registration is generated automatically and saved in mysql from a certain…
-
1
votes1
answer5525
viewsSpring Boot error 404
Hello, I am studying Spring Mvc and Spring Boot and I came across a following problem that so far I could not identify. After executing my main method I get the following message. Whitelabel Error…
-
1
votes1
answer288
viewsAbout Jasper Ireports, I need to sort columns coming from the database to be displayed sorted in the report
The problem I’ve already sorted by iReport ide, query sql in the string of the clienteDAO class, but my boss wants me to sort with one of the Jasper yard classes, I’m searching unsuccessfully.…
-
1
votes1
answer752
views@Size, using Hibernate Validator, accuses error in value that should pass validation
I have a Java SE application where I can’t use the @size annotation. This annotation is worked out by the org.hibernate.Validator.Size. There is a user field in the model where I do so: @Size(min =…
-
1
votes1
answer75
viewsDelete From Database without deleting related objects
I have a system in which I register Instructors and Students, each Instructor can have several Students under supervision and each Student can have only one Instructor or no Instructor. My problem…
-
1
votes1
answer71
viewsSet ID manually with Hibernate in AUTO mode
Hi, I was wondering if there is a possibility to set the ID manually when using Hibernate in auto increment mode. I want it to use auto increment but in some specific situations I need to query the…
-
1
votes2
answers50
viewsIs there an API to create a similar Google Directory API service?
I find Google’s Directory API very interesting for bringing together documentation and testing environment in an objective and well organized way. I wonder if there is a similar plugin that can be…
-
1
votes1
answer554
viewsHow to inform download PDF file name using Itext/Lowagie and Primefaces?
I am able to download the generated file, but I can’t set the name nor the . pdf, just download as index.xhtml. Does anyone know how to fix it? I call the method to generate PDF like this:…
-
1
votes1
answer78
viewsIn what language can I make a form?
I need to make a form similar to this, even the fields and the (|||__|). And I was using Java in Netbeans, but I can’t do identical to these fields. What language would you recommend me to build…
javaasked 8 years, 4 months ago Inez Boldrin 147 -
1
votes0
answers94
viewsError displaying a collection of a contact’s phones and emails
I want to display on a XHTML page (JSF+Primefaces) a list of contacts with phones and emails. I can display everything I want in a test class: package com.fercosmig.testes; import java.util.List;…
-
1
votes2
answers407
viewsHow to receive user date through Jtextfield, using Jodatime?
I am unable to do the user input. I want the program to make the difference of days between today’s date and the date typed by the user. The program has more implementations but it’s just this part…
-
1
votes2
answers445
viewsDependency Injection - Two objects implementing the same interface
I have two objects from the Amazons3uploadservice classes and Databaseuploadservice and both implement the Uploadservice interface. The uploading class has the two objects injected by the Spring…
-
1
votes0
answers185
viewsSpark Charts primefaces chart
I’m using primefaces to do my graphics, but I have a problem. The graphics generate right, but I have to move the mouse to display the values as in the following example: I want the values to always…
-
1
votes1
answer77
viewsI can’t carry fields
This is my screen <h:panelGrid columns="6"> <h:outputText value="Nome: * " /> <p:inputText id="nome" value="#{funcionarioController.funcionario.nome}" size="18" maxlength="80"…
-
1
votes2
answers179
viewsError generating pdf report (Jasper)
So guys when I run my program it brings me the following error(And yes the file is in place): net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException:…
-
1
votes0
answers83
viewsWhich architecture to use to develop Chat in Java?
And ae personal, Next, I’m starting a project to do a chat, a widget actually. It’s still all on paper. The idea is that any ERP system can implement this chat... but I am at the beginning, and I…
-
1
votes0
answers120
viewsAdd new inputText to JSF page by pressing a key
I have a form where I can have several codes registered, I would like to provide only one inputText at first, if there is need to insert more than one code I press a hot key and then another…
-
1
votes1
answer77
viewsANDROID Database Connection Error
I created a database on localhost, and wanted to pull this database to my Android, created two classes, CONEXAODAO, and Conexaomysql: public class conexaoDAO { public String tabelaDepartamento () {…
-
1
votes2
answers459
viewsEdittext without Focus by Activity
Is there any command in the Activity that prevents a EditText to receive focus even with the user clicking? Or this can only be done by XML? I have a repository that is connected to a database and I…
-
1
votes1
answer1325
viewsError in Spring Project Execution
I’m developing an application in Spring (from the Algaworks booklet) and came across the following error: . ____ _ __ _ _ /\ / ' __ _ ()_ __ __ _ \ \ \ \ ( ( )_ | '_ | '| | ' / ` | \ \ \ \ / )| |)|…
-
1
votes0
answers169
viewsOverlay imageviews
I want to make a layout with images superimposed this way but I can’t overlay the images within the same Activity or Fragment someone can help me?…
-
1
votes1
answer754
viewsJava: Get name and serial number of cell phone connected to the computer
Dear first: This is not an issue involving Android development. I am doing automation in java, and I would like to know if there is any way to store the name and serial number of the device when…
javaasked 8 years, 3 months ago Luís Gustavo Vieira 83 -
1
votes1
answer3473
viewsError creating table with flyway using Maven
I’m with this error below when creating the wine table using flyway, this is a Maven project, anyone knows why gives this error? Estates spring.jpa.database=POSTGRESQL…
-
1
votes1
answer39
viewsMethod to check three objects at a time
I work with Java and JSF. I have a list of 27 objects and I have a method, called every 20 seconds through Polling, updating a field of these objects. For very specific reasons, I need this method…
-
1
votes1
answer135
viewsUse of Swingworker in connection with standalone bench
I have an application in java that I made in my work, to control sequence numbering of crafts, the same is in jar format in the network (I made using swing in java + HSQLDB). One problem that wasn’t…
-
1
votes3
answers1389
viewsHow to differentiate device type from IP?
How to know what type of device is using an IP? I wonder if there is any way to validate whether an IP belongs to a computer, a mobile device, etc. This is to differentiate device types from IP. I’m…
-
1
votes2
answers68
viewsIs it necessary to place the element type inside the Try?
When optimizing my JDBC code I started using a condition within Try. /** Função PreparedStatement stmt */ public PreparedStatement stmt; /** Funçãoo ResultSet rs */ public ResultSet rs; /** Método…
-
1
votes1
answer50
viewsAbout button rendering
Hello, folks. I’m putting together a program that works with user registration. In this project there is a screen to consult registered users. The problem is as follows: in the Register Search…
-
1
votes1
answer320
viewsAdd Primefaces to the project
What is the procedure (step by step) for me to add the first faces to my project? I already have the jar in the machine, but this jar it stays inside the Maven dependencies? I have to make which…
-
1
votes1
answer602
viewsEncryption of GET and POST request parameters
I am beginner in java and I am studying java web, mainly servlets and JSP. And I need to develop a web application as a college job, focused on security. For this I would like to encrypt the URL’s…
-
1
votes0
answers99
viewsRestful resteasy - Client (Ava.lang.Nosuchmethoderror)
I’m trying to access a Webservice Code: public void testeWSRestful() { Client client = ClientBuilder.newBuilder().build(); WebTarget target = client.target("http://localhost:8080/teste"); Response…