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
answer101
viewsAdd markers to Gmap
I want to add a marker to the point I’m showing on the map. It loads the map and everything, but I can’t add the marker. <h:body> <h:form> <p:poll interval="10"…
-
0
votes1
answer25
viewsAndroid - Change components of a Dialog
I used a Dialog to display a custom alert this way: Dialog dialog = new Dialog(); dialog.setContextView(R.layout.resource); dialog.setTitle("Diálogo"); dialog.show(); However I can’t change Dialog…
-
0
votes1
answer38
viewsDoubt with component change in eclipse migration to android studio
I have an app that was migrated from the eclipse, it uses a component: http://actionbarsherlock.com/, but it generates error in opening the application, so I needed to comment on the code below so…
-
0
votes0
answers587
viewsConstructing a java table from a vector as parameter
Hello! I’m having trouble constructing a table. Here’s the thing, the user defines a series of variables that are stored in an array. I would like the variables stored in this vector to constitute…
-
0
votes0
answers94
viewsHow to draw on a Jdialog
Hello. I have a window in Jdialog, where I put several components, which is like this: And I had to do something kind of like this: as this screen is very large, I will post only part of her code:…
-
0
votes1
answer123
viewsInserting items into an Arraylist does not work as expected
I need to add an item to the list 9 times, only when I print, only the data appears 12 , "Oi", "Aline". What am I doing wrong? package webservice; import java.util.ArrayList; import java.util.List;…
-
0
votes2
answers276
viewsReports with Jasper Ports
Good evening guys! To create reports with Jasper I need to have classes with templates? Since I already have a populated bank and I only want the reports, creating filters and tals...
-
0
votes1
answer81
viewsHow to change an image using commandButton in Java Primefaces?
Good afternoon, I’m developing a naval battle game in JAVA using Primefaces to make the front end. I would like a help to assemble a commandButton that when clicked, it triggers a function that will…
-
0
votes2
answers1839
viewsjava.lang.Numberformatexception: For input string: "code"
I am developing a project with JSF, primefaces, Maven and JPA with the specification of Hibernate and SGBD Postgreesql (I created the separate database script, then connected with Hibernate) and…
-
0
votes1
answer495
viewsProblem in Converting Photo Base64 on Android
The problem is this, I take the picture and if it in Activity, so far so good, but after converting it and sending to the server and decoding, only appears part of the photo: Code to take the photo…
-
0
votes2
answers46
viewsKnow URL read time
I’m reading the content that has a url Using the following code block: String urlNormal = "http://minhaurl"; URLConnection conn = urlNormal.openConnection(); BufferedReader input = new…
javaasked 6 years, 3 months ago adventistaam 3,354 -
0
votes0
answers77
viewsAndroid studio, Switch method hangs app
I’m having a problem with the Switch of Android studio, I just can’t do a manipulation with the data of it because it simply hangs the App on the VM. MAIN.Java a doubt, these changes are in…
-
0
votes1
answer80
viewsJava Android Studio - Recover IP from device
Good morning, friends! Does anyone know how I can recover ip from an android device? I got some codes, but only to recover the wifi ip. I need this ip, because I am working on an ad application, and…
-
0
votes0
answers24
viewsA product reference various sizes in the database. How to do?
Hello! I am developing a Java system with Postgresql, and now I have reached a stage where I am with a great difficulty. I have three tables that need to relate, are they: Product: code,…
-
0
votes2
answers821
viewsJcombobox inside a Joptionpane
Good morning, I have a list of some reasons private List<Motivo> motivos; And I need to fill a jComboBox with this list and get the selected option. Currently I did with Messagedialog where I…
-
0
votes2
answers172
viewsSum mm:ss of a jtable column
Good afternoon, I know that the way I’m going to explain it is difficult to help me. I have a jTable that contains a column where times are shown, those times in mm:ss. I need to average between…
-
0
votes1
answer2503
viewsjava.lang.Runtimeexception: Unable to instantiate Activity Componentinfo
I am running the project on my mobile phone, however it presents the following exception error: java.lang.Runtimeexception: Unable to instantiate Activity Componentinfo Mainactivity: public class…
-
0
votes2
answers493
viewsHow to do if in sql - Postgres
Need to do an if in the example postgres. SELECT log."data" AS log_data, log."tipomovimento" AS log_tipomovimento, log."nomefornecedor" AS log_nomefornecedor, log."nomeproduto" AS log_nomeproduto…
-
0
votes0
answers30
viewsAndroid - getx() function does not work
I’m trying to create a game using java without using other libraries. I was able to do everything I needed so far but I’m not able to use the getx() function in Imageview controlled by the player in…
-
0
votes2
answers121
viewsI can’t remember some concepts about class arrays
I’m wondering. 1 - Is my reasoning correct? For example, if I put Funcionário funcionario within the class Empresa, means that: "In the company has employee". Correct? 2 - How do I define a class…
-
0
votes0
answers57
viewsProblems with Sqlitehelper
Hello, I have a registration project and I’m having trouble reading Sqlitehelper, the app only runs without it, when I try to use gives error, the app turns off, if anyone can help me find where is…
-
0
votes2
answers789
viewsError installing application on mobile
I am getting this error while trying to install the application on my mobile phone, and I am not able to find the error inside the manifest.…
-
0
votes1
answer101
viewsIllegalargumentexception error when displaying data in the application
I’m trying to present everything that was recorded in my app while running, however it presents the error below: Unable to start Activity Componentinfo{com.projecto.... }:…
-
0
votes1
answer114
viewsnull return when trying to persist data
I’m having problems registration and search system while persisting in saving method of the null return, I already switched to @viewscoped my bean but nothing, debugged project and nothing, I can…
-
0
votes1
answer72
viewsString in findViewById
Hi, I was wondering if you could use a string in findViewById. I have an app with various imageview that when you need to call an Internet to the camera phone. So that I don’t need to put this Input…
-
0
votes1
answer731
viewsLeave only one editable Jtable column
I have my data model that I made for tests as shown in the code below: public class ModeloDados { private String nome; private String sobreNome; private String telefone; public ModeloDados(String…
-
0
votes1
answer54
viewsIntent on Fragment Activity Android
How to Open a New Screen or Link Via Intent in Fragment Activity? See that there is a button at the end how to make it open a link?…
-
0
votes1
answer39
viewsError in this repeat loop. It is only taking the first value of the database
Error in this loop of repetition. It is only taking the first value of the database. You’re just doing the consultation in the first field and you’re ignoring the others. @Controller //…
-
0
votes0
answers90
viewsError when using Proguard the first time in an Android app
My Gradle is in the following: buildTypes { debug { shrinkResources false minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release {…
-
0
votes0
answers53
viewsHow to block 2 users on the same screen - JAVA
I need to block the access of 2 people on the same screen, example, two people try to access the registration of a particular product, the second person who tries to enter should receive a warning…
-
0
votes0
answers310
viewsIdentify empty columns of a jTable and paint the entire row red
I am importing a file in Excel and playing inside a jTable, so far so good. What happens is that there is user inserting spreadsheet with empty fields. I would like to leave the whole Lina in red…
-
0
votes1
answer1050
viewsCompare Android Studio Strings
I started a few days learning android development, I’m trying to create a simple login system just for testing. Only when I create an event for the login button the comparison of the Edittext string…
-
0
votes1
answer43
viewsReturn an address
I’m finalizing a project where will open a alertDialog. Once the user presses OK he will make a confirmation and his location will be informed by a Toast. I would like to know how I can return the…
-
0
votes0
answers29
viewsonResume method is undoing Sharedpreferences from a Checkbox
I happen to want to leave the Checkbox except as agreed the user marks or not. Then I called a method to make the internet check in case the Checkbox is marked, and soon after the Checkbox was…
-
0
votes1
answer45
viewsJoins with daughter entities
I have a parent entity called OCR, this has 2 that are specialization(inheritance): OCR_A, OCR_B. My hql needs to contemplate the 2, IE, I need to give Join in the 2. I start like this: select o…
-
0
votes0
answers56
viewsI cannot read the first url line
Good night. Although I can’t figure out which error I can’t get the first line of the file that is in the url when this application is used by versions higher than api 10 because api 10 works well.…
-
0
votes1
answer851
viewsOpen Image with My Application
I am developing a java application to open image files with the class File(), would like to make my application the standard for opening the images on my computer, do not know how to receive by…
-
0
votes1
answer47
viewsError in executing activity_main.xml image
recently installed the android studio version 3.0 and followed its installation and configuration instructions, but this error appeared. I uninstalled and reinstalled and persists in it, which I…
-
0
votes0
answers92
viewscompleteMethod primeFaces is returned the id where it should return name
I am creating a form where I have neighborhood address name etc, and for that, I am using prime Faces. <p:outputLabel value="Nome" for="nome" /> <p:autoComplete id="nome" size="60"…
-
0
votes2
answers195
viewsOptimize Firebase Realtime Database and Firebase Storage actions
How can I optimize user experience and application fluidity when I’m, for example, reading data from Firebase Database or even downloading Files from Storage? Using runnable’s to handle processes or…
-
0
votes2
answers594
viewsThymeleaf - Spring boot - Empty validation
I have this code that already works: <span class="label" th:classappend="${usuario.ativo ? 'label-success' : 'label-danger'}"> </span></td> but now I want the following: <span…
-
0
votes0
answers45
viewsconvert pixel to cm openGL
I need to change an object to where the mouse is clicked, I’m trying to do with a point to start. I already managed to capture the mouse position but it comes in pixel and I need this value in…
-
0
votes1
answer40
viewsHow to use Linkedhashset to implement this Ihashset interface?
How to use LinkedHashSet implementing the interface IHashSet using chain to resolve conflicts and with load factor 0.75? //Usando essa interface public interface IHashSet{ public void put(Object…
-
0
votes1
answer422
viewsHow to implement the pessimistic lock in Java WEB EJB?
I have competition problems in my system, I need to insert the lock pessimistic because users access and save at the same time, causing bizarre errors in the result.
-
0
votes1
answer112
viewsUpdate Android App
Hello, I am new to android development and I have some doubts, I am developing an APK using a webview and I am often updating it with some improvements. As I work more than 200km from where the…
-
0
votes1
answer303
viewsHibernate does not recognize column in database
I put in a request at Postman and gave the second problem: { "timestamp": "2018-07-27T04:58:28.407+0000", "status": 500, "error": "Internal Server Error", "message": "could not extract ResultSet;…
-
0
votes1
answer217
viewsDeclare a variable using var or the type itself?
I started studying Dart and came across this question. In java, it is always used the type in the declaration of a variable. However, Dart allows you to declare both using "var" and the variable…
-
0
votes1
answer662
viewsImport the postgres library into the intellij idea IDE
I started using IDE intellij idea a short time ago to develop in java, previously used net Beans and when I was going to use the database for my application it was simple to import the library from…
-
0
votes1
answer303
viewsApp Bar does not appear
In fact it comes to appear in the program, but not in the simulator Following the Java code public class Perguntar extends AppCompatActivity{ @Override protected void onCreate (Bundle savedInstance)…
-
0
votes1
answer194
viewsNavigation between screens (Javafx)
I have a schedule program and on the main screen I have the option to Add Contact. When it is clicked a new screen is opened so that it can enter the data. When the Save button of this second screen…