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
answer453
viewsFirst faces pick chosen value in autocomplete
I’m working with the AutoComplete of primefaces and I have a problem. For example, the user enters a word in the combo OSW and then the dropdown lists all contracts with the term as supplier OSW. So…
-
1
votes0
answers133
viewsError:Abnormal build process termination - Intellij 16.1.1, JDK 1.8.0_21
This is the first time I’m wearing IntelliJ IDEA and soon had problems to compile: Error:Abnormal build process termination: /home/nathanpb/Java/jdk1.8.0_121/bin/java -Xmx700m…
-
1
votes1
answer116
viewsError setting Executesql method
When creating the execute method it generates error at this point rs = stm.executeQuery(sql) what can I do public void excutaSQL(String sql){ try { stm=(Statement)…
-
1
votes1
answer311
viewsPass parameter with ajax
My application receives in the first field of the form a directory. Through this directory I will list the files present in it. I have a method that will list the files according to the received…
-
1
votes2
answers832
viewsPress the button of a screen that is a Fragment and go to another Fragment. How do you do?
I have a class like Fragment and would like when the user clicks the button to go to another screen that is Fragment.. how can I do this? public class AlertaFragment extends Fragment { @Override…
-
1
votes0
answers83
viewsPrice transfer between online store and external page
I want to create a virtual store using already available solutions like Shopify or Iluria. Only that the service (deliveries) would not have a fixed pricing, the price would be based on the location…
-
1
votes1
answer138
viewsjava.net.Bindexception: Address already in use /127.0.0.1:13444
Guys, I have an application running on intagrator and today the system crashed, seeing the logs I came across this error: java.net.BindException: Address already in use /127.0.0.1:13444 at…
-
1
votes1
answer2049
viewsHow to display date and time "at runtime"?
I would like to know how to display the current date and time of the computer, and the time should be updated at runtime. I thought of passing an object to a label, but it did not. I’m not going to…
-
1
votes1
answer131
viewsHow to display the time the program is running?
I wanted to know if there is a way to take the time that the program is running, and display on a label. From the moment it runs, it is "running a time", ie shows exactly the time it is running.…
-
1
votes1
answer107
viewsHow do I move a triangle around the corners of the screen using java?
I’m pretty new with java and I’m working on the project that I have to draw a triangle (which I have to call Alice) that is located in the upper left corner of the screen and it has to move in a…
-
1
votes1
answer298
viewsError while trying generates Ionic apk v2
Commando: ionic build android --prod Environment variables: ANDROID_HOME C:\Android\sdk CLASSPATH .;%JAVA_HOME% JAVA_HOME C:\Program Files (x86)\Java\jdk1.8.0_121 Path ;%JAVA_HOME%\bin Error: Error:…
-
1
votes1
answer178
viewsArraylist repeating itself
I have an array that whenever I refresh my page, it duplicates. I did some tests to see if it was duplicated in Javascript, but found nothing. This is the Javascript: <script…
-
1
votes1
answer404
viewsThe import org.springframework.web.bind.Annotation.Crossorigin cannot be resolved
I’m not managing to import the Annotation @CrossOrigin. ide does not find the necessary package despite all the others Annotations are working normally. The error that occurs is this: The import…
-
1
votes1
answer93
viewsValidate List of Radium Buttons with Angular.JS
I have a list of Radium Buttons fields and need to control by angular: Validations: one option at a time and display message. Code: <!DOCTYPE html> <html> <head>…
-
1
votes1
answer78
viewsNullpointerexception when trying to mount an Activity to show a video
My code: public class VideoActivity3 extends Activity { public final static String LOCATION3 = "com.compdigitec.VideoActivity3.location3"; public final static String mFilePath = ""; @Override…
-
1
votes0
answers544
viewsNullpointerexception in Jasperfillmanager.fillReport
Renho an application and when it arrives in this line JasperPrint jp = JasperFillManager.fillReport(in, null, conn); The system returns the following error message : Exception in thread…
-
1
votes2
answers106
viewsReturning an object. Any Smell code here?
I thought of the following public method: public RespostaDeArme armar(); The class RespostaDeArme would be so: public class RespostaDeArme { private final ResultadoDeArme resultado; private final…
-
1
votes0
answers180
viewsSend Byte Command via socket to a python controller?
Hello guys I am trying to send commands to a Controller "Commbox", this controller has the objective to open and close gates, traffic lights and other things. I am able to send command in Java but I…
-
1
votes0
answers56
viewsRotation parameter in Jasper or iReport does not work when exporting to ODS format
Hello! My code: <staticText> <reportElement mode="Opaque" x="282" y="0" width="59" height="82" backcolor="#C4C4C4" uuid="8c5029ee-1b1d-41e8-a82f-ef2f879009c0"/> <box> <topPen…
-
1
votes1
answer199
viewsAutomatic deploy with Jenkins/Tomcat7 - Failed to deploy application at context path
I’m trying to set up the automated Jenkins deploy for a Tomcat7 server. I was able to get Jenkins to connect to the Tomcat manager normally, but for some reason almost at the end of the deployment…
-
1
votes1
answer409
viewsAngular, Java Service REST
I am trying to make persistence (insert data) using Angularjs and Webservice REST in Java, when I click Insert in the console, the following error appears: POST…
-
1
votes1
answer561
viewsUsing enums in java
I created an Enum and I need to set the values in the bank that way: If it is Revenue, the value is 0; If it is Expense, the value is 1; This is my Enum: public enum EntryType { INCOME, OUTPUT; } In…
-
1
votes1
answer41
viewsPrimefaces Dragdrop does not fire event
I’m trying to do exactly what’s in the documentation on DataGrid I drag the components and loose in the p:droppable, but nothing happens, it gives a revert and does not create the table as in the…
-
1
votes1
answer269
viewsPass variable from daughter page to parent page in jsp
I’m making a simple crud in java using jsp and servlets. And I came across the following situation: I have a layout.jsp which makes the include of another dynamic page, which in this case will be…
-
1
votes1
answer112
viewsHow is the signature check of the super function
The function super() serves to call the parent builder and verify suitable signatures. public class Pessoa { private String nome; private String endereco; private String telefone; private String…
-
1
votes1
answer227
viewsHow to call Finish() a separate class?
I have an application where when the user clicks "Back" on MainActivity he displays a AlertDialogin the method onBackPressed() asking if you really want to quit the app. But I created a new class…
-
1
votes0
answers426
viewsHow to recover only the parameter of a url through a bean Managed
I wanted to know how to recover only the parameter of this url in a bean Managed http://localhost:8180/blabla/teste.xhtml?codigoEmpresa=754 Follow my bean Managed: package…
-
1
votes1
answer847
views@Queryparam - Type Date
I’m having trouble sending a Date, it’s always null on my Rest controller. I’ve tried it without $.param as well and it didn’t roll. My $Scope.filter.Begin is already going in Date format on request…
javaasked 7 years, 7 months ago Guilherme Nass 939 -
1
votes1
answer299
viewsE-mail Sending Error using Hotmail as Commonsmail Java
I am having trouble sending email using Outlook by returning the following error. Erro Sending the email to the following server failed: smtp.live.com:25 I tried the door 587 and with the smtp…
-
1
votes1
answer319
viewsMultiply 2 fields in Jtable
I’m trying to get a 2-field multiplication on Jtable but I can’t do it Specifically the Quantity Field and Unit Value to multiply and give the Total Value Tela do Jtable package Telas; import…
-
1
votes2
answers1828
viewsLearning to use ENUM in Java
Good afternoon. I’m learning to use the guys enum in Java and facing some problems. First of all, I created my own enum as follows: public enum enumUpdateAction { NEW(0), CHANGE(1), DELETE(2),…
-
1
votes2
answers496
viewsHow to calculate a value while the user types in an Android application?
Hello folks I am developing an application in which the user must enter a quantity and the unit value and the application calculates the total payable. But if you delete all the value that is in the…
-
1
votes1
answer799
viewsPrimefaces: Modal dialog does not open
I am trying to open the dialog of the first faces, but without success. I have the following code: Clientescadastrados.xhtml: ... <ui:define name="content"> <h:form…
-
1
votes1
answer1438
viewsSend String via socket Java
I have my Client and Server classes. I want to send String to the server. I have tried several methods but error or it sends an empty string to the server. Someone can give me a light of what I am…
-
1
votes1
answer218
viewsWhy aren’t you entering this if/Else?
I run this code and the if/else if are not entering. What can be? import java.util.Scanner; public class VerificaLetra { public static void main(String[] args) { String sexo = " "; String letra;…
-
1
votes1
answer1589
viewsRedeem values with equal class names using Selenium
I have a situation where I need to rescue values from a array of article's, however I’m not trying very successfully. My HTML is this way: <section class="list"> <article class="card">…
-
1
votes1
answer13964
viewsIF condition inside an Oracle SELECT
There are other questions in this context, but I am a layman and do not understand. With this, I need help. I have a SELECT for searching data in a database ORACLE, but I must make a condition IF…
-
1
votes1
answer525
viewsHow to center a component using null layout?
my knob I want to center is 100 pixels wide. Jframe is 350 wide. how to center? /* * To change this license header, choose License Headers in Project Properties. * To change this template file,…
-
1
votes0
answers74
viewsJava ME Emulator does not start
I’m trying to start the Java emulator for mobile devices, but when starting it directly from its executable, it presents a black screen. Then, in the system tray, appears the device-manager icon…
-
1
votes1
answer100
viewscan’t change my object from a datatable - JSF with Primefaces
I am retrieving my object from the datatable more at the time I redirect the datatable to another page to make a change, it shows an error. More takes the Object ID, I made a convert more…
-
1
votes0
answers409
viewsWhat is the best Design Pattern for Java Logger
I would like to know which is the best choice to implement Java Loggers. Currently I have used dependency inversion as the following example: @Controller @RequestMapping("/"); public class…
-
1
votes1
answer607
viewsHow to create a Listview in a Navigation Drawer?
1 My goal is this: instead of these items that come by default in Navigation Drawer I would like to put a series of Lists that will change as I create, delete and edit these lists. I tried to create…
-
1
votes1
answer95
viewsIllegalaccessexception when reading values with Reflection
I cannot read the attributes values of the class with Reflection: ContentValues values = new ContentValues(); Field[] fields = this.getClass().getDeclaredFields(); for (Field field: fields ) {…
-
1
votes0
answers99
viewsConvert an Object List to UTF-8 in java
I’m making a system Using java jsp, using webservice Restful, where I just consume data from a webservice through a link. Then on the main page, I create a list of objects coming from webservice, I…
-
1
votes1
answer328
viewsUpdate data in Listview with Arrayadapter
I have a Listview that will be filled with some different data, which may or may not be called (simultaneously or not). Example: The user can add and remove ingredients from a product. However, he…
-
1
votes2
answers939
viewsUse foreign key as primary key - Hibernate
I am implementing Hibernate in my project and arrived at a stage where I am having problems to map my entities. I have an entity called Book and would like to create a Stock entity to store the…
-
1
votes1
answer262
viewsAccess modifier for Java methods - Default
I just took a test and I found a suspicious question, I’d like your opinion. In the Java programming language, when the method of a class does not have an explicitly declared access modifier means…
-
1
votes2
answers164
viewsQuivalent method to array_diff() in JAVA
In PHP there is the method array_diff() which verifies values of two arrays and returns the items referring to the difference between them. For example: $arrExclusion = array('as', 'coisas',…
-
1
votes0
answers87
viewsHow to Create Dynamic Spinner in Java
Hello, I have a question about how to create three interdependent dynamic spinners, ie create a first spinner called "Module", from the selected value the spinner "Sub module" display only the items…
-
1
votes1
answer152
viewsFirebird GEN_ID() function equivalence in ORACLE
Speak guys, I’m starting learning with BD Oracle, before I used Firebird. However I’m having a problem that I’m not able to solve. I can not include a new country by the system (java), if I insert…