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
votes0
answers61
viewsBroadcastreceiver is not working
My Broadcastreceiver isn’t working, I don’t know what’s wrong, in my Manifest there’s this <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission…
-
0
votes0
answers76
viewsAdd Object to Jcombobox
I’m trying to add an object in the jCombo box, but, it’s saying showing the message that the Object cannot be converted to String, being that I’m using the public String toString() Follow the Model…
-
0
votes2
answers52
viewsGet mysql table id in application
I am developing an application in Java where I need to redeem the id of a Course table (idCurso, nameCurso, typeCurso). Here’s what I’m trying to do: public class Teste4 extends javax.swing.JFrame {…
-
0
votes1
answer39
viewsTransform a string array (which are links) into a Windows image on android with json
I have a json on a server with image links and need to convert to imagemView, I could only open on the android screen as string showing the image link. my json my code that receives json…
-
0
votes1
answer183
viewsA question with Hashmap
I made a simple code to register a person in a HashMap. Pessoa is a class that has name and age, but is not giving to register more than one person. Every time I show her, she shows only the first…
javaasked 6 years, 3 months ago Nathan Silva 87 -
0
votes3
answers155
viewsHow to convert JSON to Object and find an id (No Array) - JAVA
I have a Json that does not contain an array and I need to get information from this Json. Follows the JSON {"_status":"sucesso","_mensagem":"Impressão em…
-
0
votes2
answers3743
viewsJava - Taking the value of a specific JSON element
I am using the exchangerate API (https://www.exchangerate-api.com) to pick up the currency quotes of the day. Using the code below I get a Jsonobject containing the "rates": private JsonObject…
-
0
votes1
answer105
viewsError generating barcode using Jaspersoft
Trying to generate product barcodes, using Barcode4j 2.1 of JasperSoft 6.5.1, but when running on the JSF page of that error: javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError:…
-
0
votes1
answer28
viewsAndroid Studio app stopped picking up Json online from nothing
I am developing an APP, where it needs to get data online via Json from an API, without making any changes it stopped working while it was working normally, I have tested on the server that this…
-
0
votes0
answers34
viewsVolume Button (with Circular Jslider?)
Hello, my team and I are making a synthesizer for college work, in case I am doing the graphical interface and would like to make the following buttons: The mixing buttons would work like this…
javaasked 6 years, 3 months ago Vinicius R. Ribeiro 9 -
0
votes1
answer490
viewsTostring problem in Android Studio
I have String type variables and Int type variables. When I do getText.ToString() in a variable of type int Android Studio shows error due to variable type not being a String. Would anyone know…
-
0
votes1
answer36
viewsSending a Java Socket message
Hello I am "trying" to make a server socket until there I got but I am not able to make the communication between the servers. But the weirdest thing is the following check out the print below But…
-
0
votes1
answer37
viewsOnline image in Adapter
I have an Adapter in my App, and I would like to take pictures of my server to put in it instead of a photo saved at the root, I’ve tried several ways, I’ve tried even using the Picasso API but the…
-
0
votes1
answer41
viewsGoogle Play Billing Library
In the library Google Play Billing, could anyone inform me what the part is for handlePurchase(purchase)? What exactly does she do? @Override void onPurchasesUpdated(@BillingResponse int…
-
0
votes0
answers80
viewsProblems with directory accents
I need to get the directory of a file that is inside the project, but the return is not respecting the accents of the folders. Class that searches the directory: package NewClass; import…
javaasked 6 years, 3 months ago Pedro Afonso 119 -
0
votes0
answers37
viewsError showing list of images that were recovered from BD
Images are recovered normally, but do not appear in the gallery. NOTE: If I take a picture of the list and play in one p:graphicImage works normal. Mbean: package org.salomao.bean; import…
-
0
votes1
answer47
viewsHow do not have a miss click on the next screen?
I’m having a little problem with a quiz application. when the user clicks on the button the next question comes. put a delay of 1 sec. However, if the user clicks 2x on the button within this delay…
-
0
votes1
answer285
viewsJackson and json array
All right, guys? I’ve been racking my brain for a few days now but to no avail. I need to insert in the BD information that comes through JSON. It turns out that when an array comes, it doesn’t want…
-
0
votes1
answer159
viewsManipulating an object that is present inside an Arraylist
I need to do some operations of combinatorial analysis with information present in objects, but I do not know how to extract them from ArrayList. I need to remove the content present in the variable…
-
0
votes1
answer79
viewsReturn from database values
have two variables: Int id; String Produto; I want to fill the variable "id" with the corresponding value of the "product",. The data is collected directly from the database. public static void…
-
0
votes0
answers37
viewsChange text from Textview
I have a Textview to which I use a String as the text, I wanted to know if it is possible through a click to change this String(text) to a new text that is typed. public class Texto extends Activity…
-
0
votes1
answer234
viewsHow to take user image in session and add to html?
I’m developing a web application using spring boot. I already have saved image of the user in the database, now I would like to assign the image of the user logged in the session in the profile…
-
0
votes0
answers65
viewsProblems with Array
I’m making a facial recognition system, and that’s all I need to finish. I have the following code: for (int i = 0; i < facesDetectadas.size(); i++) { Rect dadosFace = facesDetectadas.get(i);…
javaasked 6 years, 3 months ago Abner Rodrigues 23 -
0
votes1
answer298
viewsclose alertdialog open with inflate
I have a project with an open dialog box with an inflate giving the user the option to type a text to change the value of a String. I’m having trouble closing this box and going back to the previous…
-
0
votes2
answers1676
viewsjava.lang.Noclassdeffounderror running application
I made a java program that uses JDateChooser for the user to choose the date they want. It works normally within Eclipse but when I export the project to a .jar and try to run by cdm it shows the…
-
0
votes0
answers68
viewsjava.lang.Nullpointerexception - Having to add a user to the database but points out this exception
Follow the code of the connection to the database, the user class and the code already in jframe: /* * To change this license header, choose License Headers in Project Properties. * To change this…
-
0
votes1
answer63
viewsAm I doing this exercise right?
Until then I am able to do it, but the method imprimiAgenda() is printing, but at the same time giving null Pointer. And also want to know if my logic is going well. If you can help me, I appreciate…
-
0
votes1
answer325
viewsHow to resolve this Error: Unknown Entity when saving to Hibernate?
Follow the code Itensvendadao: package com.livro.capitulo3.crudannotations; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import…
-
0
votes1
answer285
viewsTake data from a JSON array and add to a list in Java WEB
I have a list in JSON: {"_status":"sucesso","_dados":{"situacao":"PROCESSADO","mensagem":"Consulta realizada com…
-
0
votes1
answer34
views -
0
votes0
answers1953
viewsHow to store image in Sqlite?
I have an app with product registration that has 3 Edittext and 2 imageView. I am trying to save these values in Sqlite but there is something wrong because there is no error but also not saved,…
-
0
votes2
answers133
viewshow to print a list of numbers with an interspersed sum?
I have this list of 1 to 10. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] Code: List <Long> lista = new ArrayList(); for (long a = 1; a <= 10; a++) { lista.add(a); System.out.print(lista); } I would…
-
0
votes0
answers22
viewsI can’t get Jtable’s value
So I was trying to look for values in a Jtable, testing if what’s on the x line and the y column matches an object, but it’s not going at all and I don’t know why. I’ve tried everything =( public…
-
0
votes0
answers19
viewsProblems adding Parseuser to an Arrayadapter
I’m beginner in java programming, I’m trying to catch a ParseUser specify and send to the TimeLineFragment but it’s always null, I’ve done several tests but it’s always null public class…
-
0
votes0
answers21
viewsSelect android error
I can’t return the value inside my Arry always returns 0 Class Read public class Read { public ArrayList<RespostasAguaCasa> getLista() { SQLiteDatabase db =…
-
0
votes2
answers91
viewsHow to display Marker on the map according to the selected button?
I’ve researched and tried some alternatives, but I haven’t been successful so far. *I would like to display the "markers" according to the button pressed on the main screen. For example: A) button 1…
-
0
votes1
answer47
viewsMultiple Bags Exception / Searching multiple collections with JPA
I’m having a problem with JPA when I make an appointment. I’d like to consult Entity A that has a List of Entity B and List of Entity C (I want to consult Entity A bringing the relationships with…
-
0
votes2
answers118
viewsI cannot make the LIST page work in JSF
I have the following code I am developing with JAVA JSF, primefaces, postgre, cdi, Tomcat: BUSCARBEAN package controller; import java.io.Serializable; import java.util.ArrayList; import…
-
0
votes1
answer215
viewsActivemq in Wildfly 12
I am migrating an application to Wildfly 12 and I am not able to connect in my queue using Activemq. Log: 20:27:21,862 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full…
-
0
votes1
answer99
viewsCounter zeroing for no reason
I have a method in which every time it is triggered, in addition to performing other operations, a certain counter cont should be incremented and then call another method where it will check that…
-
0
votes1
answer54
viewsUnchanging collection adding strings
I’m starting java programming and I’m having a problem creating an immutable collection. Below is what I created: package br.com.estudos; import java.util.Collection; public class…
-
0
votes1
answer847
viewsJava - Query Spring with current date
I have the following repository with the following method @Query("SELECT m FROM Money m WHERE m.data = CURRENT_DATE()") Money findTop1IfHasMoneyInCurrentDate(); My money class is like this: @Entity…
-
0
votes0
answers374
viewsGet color name from HEX value
I’m trying to make an Android app that can capture the colors but I just figured out how I can get the HEX value but I really need the color name! Please I need an alternative that shows the name of…
-
0
votes0
answers31
viewsI can’t show custom Jtable inside the frame
create a custom table model but do not click on my frame. Someone could help me? public class PessoaJTable extends JTable{ /** * */ private static final long serialVersionUID = 3182466937648479844L;…
-
0
votes1
answer426
viewsRendering map using spring boot API
I am developing a web application using spring boot and am trying to implement a map on the main screen of the application. The latitude and longitude are being picked up in the mobile app, so I’m…
-
0
votes1
answer320
viewsDoubt about best practices for Rest API (object -> json)
I have doubts about the improvements in json/object conversion between server (Rest api) and client (javascript framework). My question is in relation to objects referenced by the main entity,…
-
0
votes1
answer67
viewsStorage firebase in android studio
I’m starting programming for android and I have a project in android studio that creates registration with photo, I added firebase and not how to create the code to send this data with photo,…
-
0
votes1
answer69
viewsPass data from a spinner to mysql
Hello, so my doubt is small and simple (but I can not solve kkk) just want to know how to pass the value that was selected in Spinner to the database by clicking a button, here my script…
-
0
votes1
answer99
viewsCan I call a class that only does a controller’s record?
I have a class of an android application that does only user registration and I called it Usuariocontroller. According to my controller, it communicates between view and model, but since the class…
-
0
votes0
answers63
viewsError in Android Nullpointerexception application
I’m trying to create an android application that generates buttons dynamically on the screen, but I’m getting an error NullPointerException and I don’t know how to treat him. Someone who has the…