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
answer68
viewsAndroid - Save and Update String sent from one activity to another
//I can send and receive two different values in one @Override public void onBackPressed() { if(checkBox.isChecked()) { String trueThumb_check = "checked_thumb"; Intent i = new…
-
0
votes1
answer46
viewsBottomnavigationview does not work on first click
I’m having a problem in my forward menu, it does not work when I click the first time, it is necessary to click twice to perform the action…
-
0
votes1
answer300
viewsJava test cases
I am trying to perform a test on the banking system that I have done, I am using netbeans for this. I need you to test the option to withdraw and deposit, in case what I have done so far only the…
-
0
votes0
answers182
viewsHow to improve ajax update ? JSF performance
I am developing a system for restaurant and I have a datagrid that updates the other. For example: I click on the class and update the product datagrid. It works, but the result is slow. I’m wearing…
-
0
votes1
answer352
viewsCallback methods annotated in a Listener bean class must Return void and take one argument: javax.persistence.Preupdate
I’m having this mistake on my console... Caused by: javax.persistence.PersistenceException: Callback methods annotated in a listener bean class must return void and take one argument:…
-
0
votes2
answers182
viewsNullpointerexception when obtaining latitude and longitude
I am developing a mobile application with Android Studio that aims to get the information of latitude and longitude and use the service of Google Geocoder to return the address of the geographical…
-
0
votes2
answers66
viewsEmail and password in the Android Studio app not registered in Firebase
No type of error appears when I click to register the button, I have put all types of password sizes and even put my own valid email only that does not register in firebase authentication. private…
-
0
votes0
answers320
viewsTomcat 7.0.76 HTTP Status 500
Good evening, everyone, I’m racking my brain with this Centos 7.0. The story is this:: I built a machine with Centos 7.0 and installed Tomcat. Until then I finished the standard page that confirms…
-
0
votes2
answers214
views -
0
votes1
answer324
viewsHibernate Duplicating Records
I am new to the use of the Hibernate Framework and so I’m having trouble solving a question. I’m using a relationship between objects as follows: @Entity @Table(name = "PEDIDO") public class Pedido…
-
0
votes1
answer1147
views -
0
votes1
answer205
viewsDownload svg image to present in Imageview of Android as?
I have an api https://restcountries.eu/rest/v2/all that returns me a json on Android. This json is binded to a class using Jackson. But I need to use the url that is contained in the json that is a…
-
0
votes0
answers469
viewsGet a return of a method in another Java class
I have a method in my Spring boot API that receives the data from the user who is logging in, checks if it exists and if the password checks. Once this is done, return returns a JWT token. I need to…
-
0
votes1
answer56
viewsError while trying to run the application with Gluon Mobile using Gradle build
Hello, I am trying to run my application however it gives the following error: please apply google-services plugin at the bottom of the build file. :compileJava FAILURE: Build failed with an…
-
0
votes2
answers97
viewsHow to make a method that compares values from two objects?
Given the following Java algorithm that calculates BMI: class Pessoa { String nome; double peso, altura; double calculaIMC () { return peso / (altura * altura); } String avaliaIMC () { double imc =…
javaasked 6 years, 9 months ago Gustavo Oliveira 61 -
0
votes1
answer244
viewsWhat is the problem with this java class that consumes a Rest service?
I have a Servlet : import br.edu.ifpb.pos.model.Art; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationFeature; import…
-
0
votes2
answers49
viewsProblem in my search engine code
As I can not use searchview I decided to use an edittext and a logica q found on a forum, but I go through difficulties have some idea? Mainactivity.class public void CarregarEncontrados() { int…
-
0
votes1
answer252
viewsCreate more than one variable using the scanner command
I did a search by google but could not get an answer that illuminated my head, I’m starting to study java and I came across the following problem: Create a Java program that reads from the keyboard…
-
0
votes1
answer328
viewsBasicnetwork.performRequest: Unexpected Response code 500 for
I am developing a mobile application that will consume services from my server, developed in the Play Framework. I have already created the login service as below: public class Services extends…
-
0
votes1
answer185
viewsHandle response from the Rest service using Volley
I’m developing an application in android studio in which consumes a service I created in Play Framework. I am learning now how to create and consume services, and I am having difficulties in…
-
0
votes0
answers228
viewsjavascript post
In my HTML I take this 'Right-Handed' STRING and pass to this JS sendPost() <tr> <td>Destros</td> <td><span class="label…
-
0
votes1
answer180
viewsGoogle Gson Problems: Unparseable date: "Apr 19, 1991"
I work with Google Gson to persist and recover Java objects. I use this code to create and format Gson, with the aim of preplanning it to receive certain date formats, which come from forms and the…
-
0
votes0
answers56
viewsPerform in eclipse but when I jar not
package teste; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import…
javaasked 6 years, 9 months ago ANY DINAMITE 13 -
0
votes1
answer592
viewsHow to use Mysql in Java EE?
I have a java (desktop) application that does some operations in writing the logs to a table in Mysql, I need to do a page that will show me this log. I did some tests, but did not succeed. I am…
-
0
votes0
answers44
viewsCast problem
I have the following classes: public class Hotran { @Getter @Setter private String codEmpresa; @Getter @Setter private String nomeEmpresa; @Getter @Setter private Long voo; @Getter @Setter private…
-
0
votes1
answer3390
viewsHow to change the color of a button?
I’m doing some experiments to get to know the Netbeans IDE better and I got this one button coloring question. Right-clicking on any jButton and selecting Properties, configure the item background…
-
0
votes1
answer50
viewsSend a command without updating the page
I am developing a web application using Playframework, and I have a problem when clicking the command I would like to display an Alert and not redirect the page as it is doing, redirecting to a…
-
0
votes1
answer309
viewsValidate form
I’m developing a mobile application in android studio and I’m having difficulty implementing the validation of form input fields. Can someone explain to me why I can’t validate? Form class: public…
-
0
votes1
answer727
viewsList of attributes with differences between objects - Java
I need to compare two objects in JAVA so I can get a MAP with key and value of the attributes that present difference. I need this logic for a generic object, capable of receiving any type. Ex:…
-
0
votes1
answer566
viewsdoubt with open and close connection
I would like your help with the link below, when I close I have the following error below, am I doing it the right way? regarding the opening and closing of the connection? my pool public class…
-
0
votes1
answer178
viewsError while listing FTP file
Good evening guys, I’m trying to make a simple program that lists the files of an FTP directory, and error is occurring. package br.com.java; import java.io.IOException; import…
javaasked 6 years, 9 months ago Fabio Aragão 135 -
0
votes1
answer275
viewsListview displays only 1 item
I’m trying to bring the list of friends to be displayed, but only the first registered appears. I’m following a tutorial and my code is identical to the one I’m following. public class…
-
0
votes2
answers383
viewsWhy can’t I erase an object with Hibernate?
I have on a screen a process table and want to delete one of them. This is a piece of mine datatable: <p:column headerText="Excluir" style="width:68px"> <p:commandButton…
-
0
votes1
answer76
viewsProblem when reloading Table
I have the following problem, at first run my Defaulttablemodel loads normally as can be seen below in red: After registering, changing or deleting once, the table updates normally, but when I…
-
0
votes0
answers217
viewsInstallation Issues with Netbeans and Javafx on Ubuntu 16.04
I am trying to continue a project (javafx) after formatting my machine with Ubuntu 16.04 linux. I installed the default-jdk from the terminal before installing the full netbeans 8.2 downloaded right…
-
0
votes0
answers209
viewsHow to terminate socket within an infinite loop?
Hello, I created a server-client project using a socket that listens on the port and sends the element of a "Queue" until the queue has no more elements. However, when I close the client…
-
0
votes0
answers37
viewsDoubt about using packages in java
I’m trying to make a import of a package in java, but I’m very doubtful and I can’t do it. Here’s the thing, I got a package at the following address:…
javaasked 6 years, 9 months ago Gabriel Borin Macedo 1 -
0
votes1
answer392
viewsI am creating a game, how to implement a pause menu?
I am creating a game in Android studio using the Surfaceview class that is instantiated in Mainactivity and a thread that is instantiated in Surfaceview, the problem is when I turn on and off the…
-
0
votes1
answer2006
viewsError injecting dependency into Springboot
I’m on the following error someone could help: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'addAlunoEBController': Unsatisfied dependency…
-
0
votes1
answer365
viewsPopular combobox inside jtable with database, how to proceed?
Currently I populate a normal combobox this way: this.CadperfilLinha.removeAllItems(); try { Class.forName(Auxiliar.AcessoBanco.getDriver()); Connection con =…
-
0
votes0
answers52
viewsProblems with Left Join with Eclipselink - Java
I have a problem with the following query: SELECT * FROM tipo_calibracao t LEFT OUTER JOIN fator_medio f ON (t.id = f.tipo_calibracao AND f.lote = 42) ORDER BY t.id ASC; Java: public…
-
0
votes2
answers897
viewsKeystore loading all certificates
I’m creating a webservice which connects to the eSocial, requiring mutual authentication. When I have only one certificate on the machine, no problem at all, but when it has 2+ certificates, I can’t…
-
0
votes0
answers50
viewsWhy does Jframe have different sizes between window mode and full screen mode?
Well, I was doing the setLocation so that the Graphics are compatible with any game resolution. Then I realized a certain problem when I tried to make a frame.getHeight - figura.getHeight (The…
-
0
votes0
answers145
viewsUpdate on Cascade Oracle with composite primary key
create or replace TRIGGER cascade_update AFTER UPDATE OF project_name ON PROJECT FOR EACH ROW BEGIN UPDATE VEHICLE SET project_name = :new.project_name WHERE project_name = :old.project_name; UPDATE…
-
0
votes1
answer63
viewsProblem in table name during creation by Hibernate
I am "announcing" an entity Menu using Hibernate/jpa, and Menu contains an entity ShareActivity embeddeble that I created. @Entity(name="menu") public class Menu implements Component { @Embedded…
-
0
votes1
answer99
viewsError while trying to implement Jtextarea in Jtable
I’m trying to use this JTextArea in some columns of mine JTable, but something’s going wrong. I know it’s wrong, but I’m using DefaultTableModel. public class TextAreaCellRenderer extends JTextArea…
-
0
votes2
answers144
viewsWhen opening a dialog block tabs
Headlines How to do so when opening this dialog, block the tabs not to be clicked on my screen. <p:dialog id ="dlgPagamentos" widgetVar="dlgPagamentos" closable="true" resizable="false"…
-
0
votes1
answer189
viewsError in 3x3 matrix
I’m having difficulties in a java code. I’m trying to make a code that generates a 3x3 matrix. I made a code that at first glance works everything Okay. matriz3x3 public static void main(String[]…
-
0
votes1
answer116
viewsJPA read-only database
Good morning, I have an unusual case for me. A database where I need to make selects and update in 1 or 2 columns of a table. I would like to know how to configure my persistence.xml Persistence.xml…
-
0
votes1
answer80
views"No Resource found that Matches the Given name" in values.xml
I made some changes to the build.gradle application, and I think this caused a Resource error, which I still haven’t found solution. build.Gradle: apply plugin: 'com.android.application' android {…