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
answer136
viewsIs it possible to convert an Arraylist<Double> to Arraylist<Integer>?
So, guys, I’d like to know if there is and how to make the conversion of a ArrayList<Double> in a ArrayList<Integer>?
-
1
votes2
answers1066
viewsJava - Could not find main class
The code below does not compile: package app1; public class main{ public static void main(String args[]){ System.out.println("Hello World!"); } } The following message appears in the terminal:…
-
1
votes0
answers318
viewsCrud with tables related in spring mvc
I’m developing an application java, using spring mvc. And in a functionality CRUD, I have an Incident Registration screen. On this screen, I have the fields mapped according to Incident.java.…
-
1
votes2
answers28
viewsJlabel does not receive new text
That code was meant to be when he clicked the button the same became invisible and the lblVira becomes a number between 0 and 10, gives no error message and compiles only that the lblVira not "grab"…
javaasked 7 years ago Guilherme Freitas 55 -
1
votes1
answer148
viewsPick up Frame already started from the "Event Dispatch Thread"
I have a desktop application on swing, and in it, I have a single JFrame which is always visible while the application is open. There are also some JDialogs modals dependent on this Frame, which…
-
1
votes0
answers216
viewsHow to add a Expandablelistview in Android’s Navigation Drawer menu
I created this Navigation Drawer that already comes in Android Studio itself: However, I wanted to know how I can transform this list of it expandable. I want to put sub-items for each item in the…
-
1
votes1
answer108
viewsApache poi Spreadsheet
My code when generating a spreadsheet inside an excel file it erases all the others, as I do for it to create the spreadsheet in 2° without it deleting the others? My code: import java.io.*; import…
-
1
votes2
answers1197
viewsHow to save to Date type in this format 10-10-2017 using Simpledateformat?
How to save a Date in format 10-10-2017 using SimpleDateFormat? Date data = null; SimpleDateFormat formato = new SimpleDateFormat("yyyy/MM/dd"); try { data = formato.parse(dataInicio); } catch…
-
1
votes1
answer661
viewsClose window by clicking Jbutton
It is possible by clicking a button and the JFrame be closed as if you had clicked on the window X? If possible, how do I create it? From what I’ve studied is using ActionListener but I can’t find…
-
1
votes1
answer60
viewsParameter name does not match with the variable passed
void countdown(int max, boolean output) { for (int i=max; i>=0; i--) if (output) println(i); } void setup(){ int top = 20; countdown(top, true); } There is something wrong with the syntax/writing…
-
1
votes0
answers116
viewsI can’t extend a Jframe class in Eclipse
I am trying to extend a class of Jframe to create a window, but in eclipse appears the following error: configure build path -Open the Java build path Property page of project "Chat" The code would…
javaasked 7 years ago Diego Soares 403 -
1
votes3
answers77
viewshow to send 2 values to php & get http//localhost/.... php? kk=par1&zz=par2";
Good afternoon guys I’m having a little problem... I have two values to assign the connection php via web serves... the values are saved in sharepreference and saved in "txtid"... to everything ok…
-
1
votes0
answers59
viewsAjax does not pass information to Servlet
I have a problem with the code, Servlet is not called. It only works if I put action="Fileuploader" in the form. Is there an error? Is there any other way? What I need: an array of images, where…
-
1
votes0
answers43
viewsNullpointexception using JSTL
Hello. Guys, I’m having a problem trying to pull up a list of users using a c:foreach. When requesting the list, a Nullpointexception is returned, which, although I understand the reason for the…
-
1
votes0
answers94
viewsDynamically editing a variable on android
Hello, I have an Activity that has some Textview fields and right below I am putting some Edittext so that I want to change these fields I insert the data and click on the button and it…
-
1
votes1
answer255
viewsHow to remove the project name from the Java Servlet URL
I have a question and I’ve searched all over the internet and I haven’t found it, how the hell do I get the name of the project from the url in java? ex: http://localhost:8084/MeuProjeto/login for…
-
1
votes1
answer111
viewsHibernate Problem 4.3 with Glassfish 3.1
My application with Hibernate 4.3 wheel normally with Glassfish 4, installed together with the IDE NetBeans. However, the server where I need to deploy the application, has the Glassfish 3.1. On…
-
1
votes1
answer44
viewsError converting a data from one class to another
I’m using JSF in a project, I have a working "W-A" screen that displays the "T-A" table data in a grid. In this grid, each row has a button that forwards to a new screen "W-B" where will be…
-
1
votes0
answers251
viewsVarious databases accessed at the same time JPA
Today I have the following scenario: my customers enter my site and appears the login screen, where I ask the User Group, Login and Password. For the Group I have a database, where it has the data…
-
1
votes1
answer112
viewsAndroid - Problems Streaming AAC
I have a problem with streaming audio, it runs perfectly on some devices and on others it does not run, I wonder if there is any way to solve this. It runs for example on a Galaxy ace 4 neo, but…
-
1
votes1
answer352
viewsOpen Panel through a Jmenuitem
I need to know how to make one JMenuItem open a JPanel, that is, by clicking on JMenuItem, open the corresponding Jpanel, this in Eclipse, via windowBuilder. This is the image of my screen with the…
-
1
votes1
answer148
viewsSelectonemenu (Primefaces) field not saved in the seat
I’ve come to ask for your help again because I need to finish my CBT. I have a dialog which has several fields, one of them is a <p:selectOneMenu>. When I fill in all fields and go save, all…
-
1
votes0
answers43
viewsLinks WSDL: Gravataí
Next, I need WSDL links to Gravataí, I’ve searched the manuals and site of the city and the developer (IPM) but there are only php links. I contacted them and again: Only php links. Someone who…
-
1
votes1
answer99
viewsDistinc Criteria Hibernate java
I have the following context: class Entidade1 private Long id; private int commentId; private int userId; class Entidade2 private Long id; private String descricao; - I have the following criteria…
-
1
votes1
answer83
viewsProblem sending notification with parameters
I’m having problems in an android app, when trying to send a notification everything happens 100% until you arrive at the opening of the notification Activity. This call Activity needs a "store"…
-
1
votes1
answer52
viewsUpdate class fields with sequential names
How to update the background color of 15 JTextField during a loop? For example, I own the following JTextField: txtEsp1 txtEsp2 txtEsp3 ... And I want to create a loop, to set the background of the…
-
1
votes1
answer1376
viewsjava.lang.Classcastexception: org.dom4j. com wildFly10 and Hibernate 5
I’m trying to use wilddly10 but every time I put the dependency on Hibernate 5 in Maven runs the error. java.lang.Classcastexception: org.dom4j Dependency on pom.xml <dependency>…
-
1
votes1
answer1714
viewsHow to restrict the value of the variable to only two decimal places?
I want the r with only two decimal places. double r = Math.abs ((aux5 - ((aux1*aux2)/previsoes.length))/ (Math.sqrt(Math.abs((aux3 - ((aux1 * aux1) / previsoes.length)) * (aux4 - ((aux2 * aux2) /…
-
1
votes1
answer141
viewsAppear 1.0k instead of number 1000 and so on
How can I make it appear instead of 1000 appear 1,0k and so on? 1000 - 1,0k 2000 - 2,0k 10000 - 10,0k 100000 - 100,0k and etc... @Override public double getValor(String arg0) { Pessoa pessoa =…
javaasked 6 years, 12 months ago user92401 -
1
votes1
answer859
viewsAccess Webservice localhost - Android Studio
I have a webservice that was made in ASP.NET in Visualstudio 2013, I am running it locally (localhost), and I am not being able to access it in the android emulator of Android Studio, nor on my…
-
1
votes1
answer92
viewsProgressidialog closing before the Second Activity opens
I have an Activity called Login_activity, when the user logs in, I want a Progressdialog to appear, until the other Activity is fully loaded, because as I will put some things to execute in the…
-
1
votes1
answer63
viewsjava: how to access an object through a string
I have a grid with several rows and columns and each cell has a Label. Each Label is named by column and row (example: a1, a2, B1, B2, etc), has how I access these Labels through a String? Example:…
-
1
votes1
answer497
viewsI can’t register a Java Arraylist
I’m making a Java (console) application. It’s time to register a arraylist She goes, but when it’s time to show, she shows me trash. What do I do? Follow the code: Main class: //classe main import…
-
1
votes0
answers49
viewsError when Injecting DAO EJB
I have an EJB project built with JDK 7. Currently in production we use Glassfish-3.1 as an application server and we are trying to migrate it to Payara-4.1. We were able to upload the application…
-
1
votes1
answer1662
viewsJSF error: javax.el.Propertynotwritableexception
I have an error that I can not solve and do not know the reason Follow error and my classes and view below. type Exception report messageInternal Server Error descriptionThe server encountered an…
-
1
votes0
answers95
viewsHow to return BD Json text to Arraylist in Java
I am having problems converting a set of texts in the Json format of the database to a set of Arraylist texts in Java. Follow the code below: Java model. public class Sala { private String…
-
1
votes1
answer190
viewsBigdecimal error cannot find Symbol
Given an amount in R$ convert it into dollar. Well, based on this context, the teacher requested that we use the object orientation paradigm. Before I should clarify that I use to order ide Bluej to…
-
1
votes1
answer182
viewsString for Array/List
I got the following String: [{"Monstro":"Lobo","HP":100,"Level":2},{"Level":"1","HP":"100","Monstro":"Bruxa"}] And I need to put her inside a Array ou List to take the values of each monster. How do…
-
1
votes2
answers6518
viewsHow to Configure Maven/Java Environment Variables
I have set the following environment variables JAVA_HOME C:\Program Files\Java\jdk1.8.0_144%MAVEN% MAVEN_HOME C:\Users\Rafael Storm\Desktop\apache-maven-3.5.2 - (extrai o Maven) MAVEN…
-
1
votes0
answers1551
viewsUse SELECT NEW JPQL to popular DTO in a @Onetomany relationship
Talk to the guys! I am trying to popular my DTO object, whose main object has a Onetomany relationship. Follow the code for vcs observations: ## Mapped Object: public class Usuario implements…
-
1
votes1
answer182
viewsWhy does Netbeans suggest changing an array addition?
I am starting my studies in programming with Java. I am creating a class for object in Netbeans that warns the following message: Array concatenated with String Why? My code: import…
-
1
votes0
answers81
viewsJSF and JPA with Eclipselink: Inserting element twice in the database
I’m working on software and I’m having a certain headache to insert some related objects. It is inserting this object twice and the error is not viewable. To see the whole project, follow github…
-
1
votes1
answer98
viewsList change from an Apache poi excel import
The system can generate an excel file where all the products of a serialized stock are found. What I would like is that when this file is imported back that all changes made to it are applied within…
-
1
votes1
answer235
viewsHow to receive notifications within an Activity
I can send a notification from Firebase to my App but Open that same notification doesn’t open inside the Activity I want. How do I direct this notification to Activity so that I can see the message…
-
1
votes1
answer357
viewsRestcontroller Spring, how to limit the number of requests!
Dear friends, I have a API Rest with the RestController from Spring, it receives hundreds of simultaneous posts, and with each post, I need to query and store data in the database. The problem is…
-
1
votes1
answer47
viewsConvert Wrong sequence string to display
I own a string in the following format 2017-12-08, but need to display it formatted for the user as follows: 08/12/2017, I thought I’d use the SimpleDateFormat but for this I need the variable to be…
-
1
votes1
answer200
viewsImprovements to Entitymanegedfactory JPA
Staff I am working as follows , I have 2 PersistenceUnit , one from the Manager’s database , which is where I find the data from the clients' databases ,another from the clients' database , which I…
-
1
votes0
answers657
viewsWhat is it and what do you do with each of these SHA-1, SHA-256, HASH, MD5 on a day-to-day basis?
What is and what is done with each of these SHA-1, SHA-256, HASH, MD5 on a day to day basis?
-
1
votes0
answers155
viewsBlocking the Interface in Netbeans
I’m developing a program for client-server communication. I am developing the graphical interface of the program based on JPanel/Forms. The client data is sent correctly to the server. My problem is…
-
1
votes1
answer407
viewsCss not found html page - Springframework
Hello. I’m having trouble getting the css, js, fonts etc of my project on my pages. I am using Spring, typing the address of the css files in the browser but the system is not able to find the…