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
answer66
viewsJSF REQUESTS
If I make a Request for my bean and this bean will make a query in a list. A list of Cpf for example. Can I update the client of this request to each result of this loop made in the bean? I ask this…
-
1
votes1
answer269
viewsHow to pass a class as a parameter in another class and return a variable that is within a Thread
I work with Delphi and I decided to learn how to make java applications, and I came across a problem. I have this class public class Dados { public void getJson(final String url) { new Thread(new…
-
1
votes1
answer488
viewsJava Static variable assignment and update
I have a problem with a static variable. In the code I assign a variable that is not Static, the contents of a static variable. Then I update the static variable, only the variable that received the…
-
1
votes1
answer552
viewsConvert base 10 to base 2
I’m trying to create an algorithm that converts base 10 to base 2. It is apparently converting, but is not returning the right binary value. package basicojava; import java.util.Scanner; public…
-
1
votes1
answer510
viewsCreate iReport variable for database
I need to create a report of the selected month with the information contained in the database, for this I intend to create a variable in iReport that receives the month (by netbens) which will be…
-
1
votes1
answer38
viewsJsoup doesn’t seem to be working
Hello I have this piece of code that gives a link and that goes online with jsoup takes some information and then puts that information in an Arraylist used in a Listview. But the problem is that I…
-
1
votes1
answer713
viewsAdd +1 Variable to each created object
I’m creating a candidate class, where I’ll pass on a candidate’s name and number. In it I created a vector, to store the candidate’s number. So that there is no equal candidate number. I created a…
javaasked 7 years, 10 months ago Thun An Freitas Chiu 23 -
1
votes1
answer53
viewsError doing email query in bank
I am getting an error in Netbeans when making a query in an SQL database that validates user login from email: package Modelo; import java.sql.Connection; import java.sql.PreparedStatement; import…
-
1
votes0
answers57
viewsTransformer or Converter?
I have worked on some project and come across situations where a certain object has to be transformed into another. In general, these are java classes originated in COBOL that I convert to another…
-
1
votes1
answer203
viewsKnow the size of an image on Android
I am developing an application on Android. I need to get the RGB of a certain image in 5 specific points of the image. as shown below: I am using the following code to capture the image RGB: int…
-
1
votes1
answer197
viewsIdentify EOF in a Datainputstream
I am making a program that needs to read a binary file and go extracting some information from it, what I have so far is the following: public void processarArquivo() throws Exception{ try {…
-
1
votes0
answers86
viewsError in passing Java parameter
I’m starting to learn Java and I’m having a problem with a simple code I did. It is a program that reads a text input and then prints on the screen, but when trying to compile this error occurs here…
javaasked 7 years, 10 months ago Diego Soares 403 -
1
votes2
answers322
viewsDoubt about how to iterate on an Arraylist
I have this exercise below to do put in question "D" I’m struggling , if someone can explain me how I should do : a) Create an interface called ModeloContato with the methods getNome(),…
-
1
votes0
answers62
viewsTake database information and add in inputs
I’m developing a web system and I’m having a hard time finishing CRUD. The system is already saving my pacthpanel object, it has equipment registered to this patch. The information is being saved…
-
1
votes0
answers18
viewsExpandable Listview is not being made
Well I am here to make a program that takes data from a website and meta in an Xpandable Listview , I am able to take this data and I have everything organized , the Arraylist "courses" is the Array…
-
1
votes0
answers294
viewsWeb Service Soap Server - WSDL - Java Eclipse
I know that there is already a lot of blog post related to web service in java and also know that there have been many questions with this problem. But I tried every way and I couldn’t fix it, so…
-
1
votes1
answer303
viewsLike putting a Jscrollpane in a Jtextarea?
I’m trying to create a project where I print several sentences in one JTextArea, but for that, I need to include a JScrollPane. I looked at some examples on the internet but none is working. public…
-
1
votes1
answer1800
viewsConvert a JSON String to a JAVA Object Array
Hello, I’m not getting the conversion, my string is coming like this. { "empresa1": { "category_id" : "Item 1", "id" : 1, "imagePath" : "imagem", "name" : "empresa 1", "short_desc" : "desc da…
-
1
votes1
answer768
viewsString JSON - Two decimal places
I’m reading a JSON object, and I can get the data from TextView. However, in the value of String Preco when the price has a zero in the second decimal place, it does not print in the TextView. For…
-
1
votes2
answers92
viewsKeep the item focus Bottomnavigationview clicked after rotate screen
I have a problem when I rotate the screen. I have the following structure: A Homeactivity that handles clicks on Bottomnavigationview (there are 4 items) Each Bottomnavigationview item loads a…
-
1
votes0
answers144
viewsJPA does not update children record
I have a little problem with JPA which is the following, I have the class ModeloEstoquePecas, where theoretically I need to delete everything first, which are the children’s records of the class…
-
1
votes1
answer260
viewsJava filter for specific pages
How do I control the access of pages with Java? I have a filter already implemented, which controls whether the user is logged in or not. However, I have a page that I need to check the user’s…
-
1
votes1
answer147
viewsprogress bar is not updating correctly
I’m developing a data synchronizer, where every five seconds I check for data being synchronized. The synchronization part with the check time every 5 seconds is already working. However, I could…
-
1
votes1
answer47
viewshelp with JSF code
In the system q being developed the registration part presents the following error when saving /status/editaestado.xhtml @13,134 value="#{Estadocontrol.Estado.nome}": Target Unreachable, Identifier…
-
1
votes2
answers542
viewsHow to convert json to object and put into a system.out.println?
I have the following code that returns a JSON: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import…
-
1
votes1
answer31
viewsHow you notify in the Jsoup function
I have to notify an action that occurs within the site , I have the following code that. It appears in a texview and wanted to notify enves of sending the name to textview. Textview txv; @Override…
-
1
votes1
answer59
viewsSearching parameter by editText
I’m having trouble fetching some data from a specific parameter, in my android app, in the webservice I already search and using GET with the data I want it brings me the data, but I need that when…
-
1
votes0
answers25
viewsA web element is clicked but no action is performed (Android)
sorry for the language, but so I’ll be more direct I’m having a problem, I find the (mobile) element in a real device, point to it and click, but always returns the error message…
-
1
votes4
answers482
viewsComparing Strings using Arraylist
I need that in the repetition it identifies the same strings, I know that I need to use the . equals(), however, is giving error, as if the variable x is checking more value that exist in Arraylist,…
-
1
votes1
answer94
viewsError when sending e-mail via production
I’m using javaxmail to send the e-mail via system, but locally I can send the email without problems, but when I put it on the server it returns me the error: java.lang.Runtimeexception:…
-
1
votes1
answer219
viewsInsertion of float value into a Jsonobject
I have the following situation, I have an object called Item, with a value variable in it. At the time I enter the value in the json object it changes from 1 or 2 boxes after the comma to 15 boxes…
-
1
votes1
answer81
viewsidentify Nullpointerexception
I am JSP, and during the test of a DAO, I came up with a Nullpointerexception here. However, I am not able to identify why. I am using Preparedstatement and pulling the count "INSERT", which I…
javaasked 7 years, 10 months ago Tony Michael 43 -
1
votes1
answer202
viewsChange FAB color via code ( programmatically )
I’m developing a Activity customized, where the colors of the screen elements will vary according to their properties. Example: If the property guy of the object Message exhibited is "Azul", then…
-
1
votes0
answers76
viewsLoad only div from a specific site
Hello I am trying to take all the information from a page to a webview via jsoup but the letters are all deformed when I load and it doesn’t look like this on the site , there is some way to load…
-
1
votes1
answer88
viewsJavax, @Defaultvalues, @Prepersistent, @Preupdate
I’m learning to play with Javax, and persistence of Java and I want to know if there’s any way to leave a default value for the database. Example in SQL: variacao TIMESTAMP DEFAULT CURRENT_TIMESTAMP…
-
1
votes1
answer86
viewsJtextpane Word Wrapper
I’m not finding a way to organize the lines within a Jtextpane, and I need to continue with styling but also with a Word Wrapper, there is some method or some component that does similar? public…
-
1
votes2
answers65
viewsWhat is the behavior of a method that returns integer within the if?
I have the following test code (Java language): public class Teste { static int n = 10; static int[] vB = new int[10]; public static void exibir(){ for (int i = 0; i < n; i++) {…
-
1
votes2
answers117
views"java.lang.Outofmemoryerror" error with List
I have the following statement of the problem: A method that takes an integer as a parameter and returns a list of integers with their decomposed prime factors. As an example, if the input is number…
-
1
votes1
answer377
viewsUse set with scanner and array
I have the following question: I am using the following code that works smoothly System.out.println("Digite a Primeira Nota: "); Scanner inNota1 = new Scanner(System.in); estud.notas[0] =…
javaasked 7 years, 10 months ago cracker alphazer0 11 -
1
votes2
answers1379
viewsobject problem on top of each other in Android Studio
I’m learning to create android apps, but face appears an error when I test the app on mobile, and text is on top of each other, or any object I add. in Android studio is like this: xml: <?xml…
-
1
votes0
answers243
viewsIncorrect character display in html/jsp page
I was designing a website for academic purposes, but I came across a visualisation error. My html/jsp pages are not displaying the accented text correctly when retrieving from the database. All are…
-
1
votes1
answer181
viewsSend json to webservice and return status
Guys I’m doing a course of Caelum 36 but I stopped at some point I need to do this: curl -i -H "Content-type: application/json" -X POST -d '{"valor":"39.9","titular":"Fulano"}'…
-
1
votes1
answer419
viewsHaversine formula for SQL SERVER
Guys, I have an Android app that uses Google Maps API. On the map, I get data from an SQL Server database. I need to create a KM radius where I only upload the database data that’s inside this…
java android sql-server web-service google-mapsasked 7 years, 10 months ago Gabriel Moreira Carvalho da Lu 13 -
1
votes1
answer169
viewsJava Web + Ajax + Servlets
I’m having a hard time trying to get the date in Ajax. When I run the code, I get the status 200 and network in the Chrome debugger I can see the return, but I can’t do anything else with the date,…
-
1
votes1
answer51
viewsJslider does not appear in Jpanel after inserting
I was trying to add a JSlider in a JPanel but he doesn’t show up. Could you tell me where I’m going wrong? import java.awt.Dimension; import javax.swing.BorderFactory; import javax.swing.JFrame;…
-
1
votes1
answer41
viewsHow to print selected items?
while(resposta == "sim"){ System.out.println("Informe o Numero do Produto desejado"); System.out.println("15 - Parafuso, 20 - Porca, 30 - Arruela"); cod_peca =…
-
1
votes1
answer236
viewsCreating Row filter "dynamic"
I’m using RowFilter to create filters for certain columns in my table. My intention is to pass the components that I want to use as "bar" search by Paramento, creating them dynamically, and likewise…
-
1
votes1
answer1262
viewsSum of matrices in java matrix A+ matrizB, results in matrix C
I need to make a matrix sum algorithm in Java, in which the sum of the matrix with the matrix B, generates the matrix C. if the matrizA has the same number of rows and columns as the matrix B.…
-
1
votes0
answers495
viewsSearch Width and Depth in a graph
I need to implement a system of visits, and the search in Width (graphs). How to proceed? [EDIT] I would like to know the best way to make this algorithm work for Graph as well, because it is…
-
1
votes2
answers471
viewsOpen BLOB in php
I have a field of type BLOB to save images in my mysql, the image comes from an android APP via POST, the way the string BLOB arrives I saved in the bank. When I try to show the contents of this…