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
answer217
viewsHow to capture more than one attribute from a foreign key?
I’m doing a Java-Desktop Vehicle Rental project. I’m using MVC, DAO and JDBC. In my bank I have the tables Rental and Car: CREATE TABLE IF NOT EXISTS `frota`.`carro` ( `idcarro` INT(11) NOT NULL…
-
0
votes1
answer61
viewsReturning Nullpointer in controller
I have a method in controller which has as its function to make a query in my bank and after returning me only one field of this search, however I am taking nullpointer in the first for that I’m…
-
0
votes1
answer252
viewsrecover item position in listview
when the person clicks on item A in the fragment categoria I would need to take it to an Activity. And when I click on item B take it to another Activity, so I can make the filters. Here the class…
-
0
votes0
answers139
viewsInsert horizontal scrolling in line chart in Mpchart Android
I’m using the library Android Mpchart (v3.0.1) to draw graphics on my Android app, however I wanted to make my chart scrollable on X-axis, this is my code: private void loadDadosGraficoLinha()…
-
0
votes1
answer136
viewsMediaplayer does not play existing sound file in Assets folder
How do I run the sound in the Assets folder in Android Studio? When the sound is in the raw folder runs normal, but I need to run in the Assets folder, to pass the name dynamically, below is the…
-
0
votes3
answers243
viewsList error with null reference in Java
Calling any method in any null reference will always result in an exception. How could I fix this? public class frmStatusAprovacaoGeral implements AdapterInterface{ @Override public void…
-
0
votes1
answer244
viewsMessage is not being displayed
Inside my form has a autocomplete, When activating the autocomplete and if the previous field has not been filled I want to send a message stating that the previous field must be filled. I…
-
0
votes1
answer275
viewsOpen clicked Listview item in a new Activity
I am creating a project, but I am not able to open the item listView. I am already inserting and editing, but I can only open the last created item. For example, I have 10 items in the list, but…
-
0
votes1
answer471
viewsListview does not load all items
I’m using Listview in my project, it was duplicating the values, until I put the ELSE of this condition: if(convertView == null)... else... After this it stopped duplicating, but also stopped…
-
0
votes0
answers109
viewstag p:commandButton does not do what is in managedBean
I’m starting now at jsf primefaces and I’m in trouble. My commandButton is not executing the method that is in managedBean and is not shooting anything on the console when you click on it (even when…
-
0
votes1
answer4842
viewsConvert from String to Json in Java EE
I am receiving a String in a . jsp and would like to convert it to JSON, thus accessing the values of the same. I’ve searched everything, but I couldn’t solve my problem, because I can’t access the…
-
0
votes1
answer3383
viewsUpload and download image to project folder using Spring Boot
I am developing a web module that I need to upload an image. Save to the project folder, I am using Apache’s Commons Io: public class FileUtil { public static void saveFile(String path,…
-
0
votes0
answers1749
viewsError "The application may be Doing Too Much work on its main thread" Android
Good afternoon guys, I am in need of a help to better understand how to solve this error that appears in the end: I/Choreographer: Skipped 94 frames! The application may be doing too much work on…
-
0
votes1
answer1437
viewsHow to format font and text size on a thermal printer using Java
Well, I am developing a program for a pizzeria and I need to print the orders with the respective pizza flavors, but with correct formatting, larger letters and such, the pattern is too small for my…
-
0
votes1
answer430
viewsHow to pass as a parameter in an item method of a foreach, a URL variable?
I am developing a project in Java, academic work. My question is in the following. I can display items related to a logged in user, where the value(nick) is set in a session with login name. Behold:…
-
0
votes0
answers177
viewsHow to create a socket in wildfly?
I need to create something that reads everything that comes to a specific door and handles that information. An Ubuntu server is used with Wildfly 10 running. The information trafficked is from the…
-
0
votes2
answers1978
viewsTextview - Leave only one word in Bold
I have a TextView which displays the following text on the screen: Like this: value: PROMOTION! As I wish: value: PROMOTION! Has as put Bold in just one word from TextView? I mean, there’s a way I…
-
0
votes1
answer421
viewsHow to implement different clicks for each item in Recyclerview?
I’m developing an app, and it has recyclerView conjugated with CardView. And all the information is stored within the app itself to be presented on recyclerView. One part of the structure is this:…
-
0
votes1
answer46
viewsError inserting data into JPA
import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity // pode usar…
-
0
votes1
answer526
viewsJAAS with Wildfly does not work
I am having problems to perform the jaas using wildfly, although I can register using Datasource normally,I could not find where the error is. While trying to access the protected resources is…
javaasked 7 years, 8 months ago Ricardo Xavier da Silva 1 -
0
votes1
answer81
viewsProblem with Recycleradpter Popupmenu
I’m having trouble with Popupmenu, when I click on imageButtom fails and gives the following error 02-14 15:27:26.531 11084-11092/? E/art: Failed sending reply to Debugger: Broken pipe 02-14…
-
0
votes1
answer219
viewsJava Poi does not download
I’m using the poi 3.15 library to generate excel on a web system, but I’m having trouble downloading the file, locally it works but when I publish it does nothing. I put it at the beginning like…
-
0
votes0
answers143
viewsHow to use onActivityResult in Activity main and secondary activitys.
I have the user Activity, and in it I call the camera using startActivityForResult, but when taking the photo, it goes to Main Activity. How can I call the camera and return to the same user…
-
0
votes1
answer270
viewsHow to put a color on the tr of a Dynamically Selected Radio
Is it possible for the line color to change after the user selects a radio from the list taking into account that I am doing the page Ubmit ? the problem is that I am not able to do because as you…
-
0
votes1
answer499
viewsHow do I identify which current Fragment when using the back button of android?
Good morning guys, all right? I have the following problem: I enter the initial Fragment of the app and on this screen I have a Pagerview, when I change Fragment and come back using the BACK BUTTON…
-
0
votes1
answer71
viewsError showing list with Arrayadapter
I’m not getting this list to be shown. I’m using a Custon Arrayadapter, but it’s not rolling. Thanks. Doing the debug, it says "Frame not availeble". Could someone give me a light? public class…
-
0
votes1
answer1116
viewsHow to write to a.json file
I have some files .json in assets. I am currently reading only in these files. Reading public String loadJSONFromAsset(String Ajson) { String json = null; try { InputStream is =…
-
0
votes1
answer245
viewsJava RESTFULL using Jersey
Guys, I’m trying to develop a project in Java with a Web Service REST, I’m new in this Web Service business, so I’m kind of lost. I cannot access my service through the browser URL, when I enter the…
-
0
votes1
answer74
viewsProgramming Android Studio
Error in Second "public class", what can I do??? If anyone knows, please say. Thank you. package com.example.hsantos_98.artofthefire; import android.app.Fragment; import android.os.Bundle; import…
-
0
votes1
answer539
viewsJPA-HIBERNATE : I understood the conjunctions and disjunctions ? Is that right?
I took some JPA booklets and read some tutorials on the internet, but I’m still a little lost with regards to disjunction and Conjunction in JPA. From what I understood the conjunction serves to…
-
0
votes1
answer37
viewslimit publications Parse
Personal following to making an app where one posts photos would like to limit the publication to 10 posts per person and when the person tries to post more images give an error message someone…
-
0
votes0
answers97
viewsWhat is Listiterator and what is it for?
What would be the function of ListIterator? I have a variable of type List, that receives the information from my Postgresql Database, I need to access the information of this type variable List but…
-
0
votes0
answers175
viewsSaving dynamic data in the same Java identity
I’m using Spring MVC, Thymeleaf and for me with all routes built he did automatic but not this working, Entity, Repository, controller and etc. I have a relation of N=N of course to Turn, of that…
-
0
votes1
answer221
viewsJava Sftp upload method never ends
So, I made a program in Java using Netbeans to upload an "X" file to an SFTP server and the method is functional, but once I start the program, it just shuts down, I’ve tried several things but nd…
-
0
votes1
answer474
viewsJavafx 8: Updating the Tableview after closing the window
I have a rating registration screen and a rating management screen from a library system. After registering a new rating, I would like the Tableview ratings, on the management screen, to be updated…
-
0
votes1
answer2056
viewsorg.hibernate.Queryexception: could not resolve Property: Request of: Classes.Client
I’m having trouble mounting a query in HQL in Hibernate,: Exception in thread "AWT-Eventqueue-0" org.hibernate.Queryexception: could not resolve Property: Request of: Classes.Client [select c from…
-
0
votes0
answers305
viewsInstantiating Object dynamically
Good morning, I need to instantiate a class according to the parameter received by a webhook, someone has some idea how to do? It would be more or less that (some scenarios): Client I receive JSON…
-
0
votes0
answers212
views -
0
votes1
answer19
viewsProblem with Menupop
Hello, so it’s no longer the first time I’ve been having trouble with Recyclerview.Viewholder, in this case now happens the following, My menu has 2 buttons I’m trying to catch the click with switch…
-
0
votes1
answer38
viewsError 404 while running jersey on apache tom-cat
I’m using jersey more every time I run error: 404 in apache tom-cat. package br.com.gomes.LojaDeVendas.util; import javax.ws.rs.ApplicationPath; // chamando o pacote do service import…
-
0
votes1
answer115
viewsI need to get the list of songs
I wanted to print the list of songs saved in an array listaMusica: System.out.println(p.listarMusicas()); This is the method for storing data: Musica v = new Musica(t, a, d, ano, g); p.addMusica(v);…
javaasked 7 years, 7 months ago Amadeu Antunes 3,331 -
0
votes1
answer223
viewsOnly print the first element of Arraylist
My problem right now is to print the various elements that are inside an Arraylist I created. How my app works is as follows:: I use a Cursor, and I will fetch the table information from the…
-
0
votes1
answer40
viewsAndroid, Onitemclicklist with Listview variable
In this code I have a list that keeps updating and adds another line in listview, however, I need her position to be able to exclude her from the vector. It turns out that there is an error with the…
-
0
votes1
answer231
viewsPrimefaces (Tabview): Null properties when saving
I’m using a Tabview with two tabs and each tab with an external file with fields. By clicking the "Save" button the attributes are coming as null. Follows the code: Clientescadastrados.xhtml: ...…
-
0
votes1
answer46
viewsInterpreting code with bundled classes
I have 3 classes in the package com\scja\exam\planetas. I also have a class with method main in the pacote com\scja\exam\teste. The method main is responsible for printing the name of the planets. I…
javaasked 7 years, 7 months ago Marcia Lima 31 -
0
votes2
answers174
viewsHow to load persistence.xml settings in Combopooleddatasource?
I configured C3P0 via persistence.xml, however, when I try to recover the configuration values via Combopooleddatasource the received values are different from what was configured in the…
-
0
votes0
answers46
viewsOne actionListener for several Jbuttons and several Jlabel
I wonder if there is a way to reuse a code for several jbuttons by changing the text of several Abels. here is part of the code: petrificarSetaEsquerda = new JButton("");…
-
0
votes1
answer57
viewsURI Rest with Httpservlet
So, guys, I’m developing a mini framework for study purposes, using the Java front controller, and I came across the following problem. First of all I’ll explain how it’s working. I embed the Jetty…
-
0
votes1
answer917
viewsGrab an Image from the gallery and move to a folder
I’m using the following code to pick up the path of an image from the system: { Intent intent = new Intent(Intent.ACTION_PICK); intent.setType("image/*"); startActivityForResult(intent,…
-
0
votes0
answers200
viewsHow to make Jframe with Jmenubar by calling another Jframe?
Hello, I have a main class that is working but when you click on the menu Register and then client it does not call the other screen Jframe Register clienteui. Here is the snippet that was to call…