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
-
2
votes1
answer1518
viewshow to simply place an icon in actionBar?
I want to put an icon on my Actionbar already searched for this information here on Stackoverflow, but the answers I found are very complicated (I’m beginner) and so I wanted to know if it has a…
-
2
votes0
answers43
viewsDoubt about Netbeans
Is there any way to do something similar to Listview of Android in Netbeans? I need to make a custom list in a Jframe, as is done in Listview Android.
-
2
votes1
answer553
viewsFind out the size of a directory
I wonder if it would be possible to find out the size of a directory in JAVA. I have a cache folder on my system and I would like to do a function forever that this folder exceeds a predefined size…
javaasked 8 years, 11 months ago Prostetnic Vogon Jeltz 408 -
2
votes1
answer1372
viewsConvert binary to hexadecimal
Is there any function equivalent to php bin2hex() for Java? I need to convert a binary to hexadecimal.
javaasked 8 years, 11 months ago Pedro Augusto 2,392 -
2
votes1
answer101
viewsAndroid/IOS vs Java
Suppose I have an android or Ios app I have a system made in java ee to publish data that will be downloaded from the internet by the application. All this is inside a web server How do I…
-
2
votes0
answers103
viewsSort chained list in MVC standard project
In my project I am using my own chain list implementation, that is, I am not using the ready list of the Java API. In addition, my implementation is of a generic list, which has Object objects on…
-
2
votes1
answer1339
viewsDifference between Merge() and getInstace() in JPA/Hibernate
I wonder when I should use merge() to update the object instead of changing it through its reference. Example: Produto p = new Produto(); p.setNome("Bola"); p.setvalor("32); manager.persist(p);…
-
2
votes1
answer184
viewsWhy is my variable null?
I am translating a function from Java to JS, the logic remains the same but the results are different. In the regular expression test, returns match when I test 40kb but when compiling the code I…
-
2
votes1
answer435
viewsHow to place border on a selected item in Listview?
How to place a border on a Listview item when the user selects that item in the android app?
-
2
votes1
answer2831
viewsWhat are Java daemon threads and when to use them?
From the Java documentation I follow the following excerpt: The Java Virtual Machine exits when the only threads running are all daemon threads. But it’s still unclear to me when to set a thread as…
-
2
votes1
answer424
viewsHow to show a jPopupMenu just below a jTextfield?
My intention is to create a search field where you type and appear the data of a query in the BD as a popup menu. I got this, it’s working. I created the menu and I can show it on the screen with…
-
2
votes2
answers3201
viewsHow to display incoming variables in a Jframe?
I’m working with server socket, it receives information from an Android app, are three information: table, order and quantity. However, I can not show this information in a JFrame, I have no idea…
-
2
votes1
answer603
viewsVariable type for precise calculations (JAVA)
What is the best type of variable for very precise calculations ? I’ve used double and Bigdecimal and the rounding is diverging much in the end result.
-
2
votes1
answer634
viewsTomcat does not update files
The problem is this, every time I change a file (index for example), restart the tomcat(v7) and F5 tightening in the browser, it stays the same, does not update anything, ie end up staying in the…
-
2
votes1
answer4632
viewsRead A tag that sits inside another in an . xml file with DOM API
Take data from a tag and right after take data from a daughter tag. For example, I have 2 tags that repeat across the entire document, and I need to take data from both: <teste:dadosLote>…
-
2
votes1
answer87
viewsError when cleaning and building: "uses unchecked or unsafe Operations."
Next, I have a "Board" class in my project that at the time of Clean and Build is showing the following error: "Board.java uses unchecked or unsafe Operations." I did some research and at first it…
-
2
votes2
answers221
viewsMemory problems when loading many images in listview
I made an application where it is possible to take a photo and save its path in the database and then show in a listview along with other information. Everything goes well when there are few images…
-
2
votes1
answer292
viewsAngular.js $setValidity onload Page
Setting: I have a form with 3 steps, a jsp for each step. In a given jsp there is a input text with the directive ng-minlength and a onChange calling a function that validates with the $setValidity…
-
2
votes0
answers186
viewsGenerate test javadoc with Maven in Netbeans
I need to generate test javadoc using Maven. I found this tutorial => https://maven.apache.org/plugins/maven-javadoc-plugin/examples/test-javadocs.html It worked, however, I can only generate…
-
2
votes1
answer353
viewsAjax Status == 0
I’m using a function in ajax to make some dynamic requests, but the req.status is returning 0 instead of 200. What can it be? Below the code: if(window.XMLHttpRequest) { req = new XMLHttpRequest();…
-
2
votes2
answers864
views -
2
votes1
answer189
viewsHow to generate default values with JPA Hibernate
I would like to optimize my code and my work with the following situation. I have an address entity that has a type, ie another entity called Tpendereco. Since, this table has standard values,…
-
2
votes0
answers115
views -
2
votes0
answers239
viewsHow to open Certificate Store and select certificate with Java?
I would like to know how it is possible to open the Windows Certification store and select the certificate to be used using the Java language. Using CAPICOM and even the C# classes X509 the result…
-
2
votes2
answers303
viewsCache Problem - Writing database data to Java system
I have a system developed in Java using JPA, Hibernate, Primefaces. When I write system registration reflects in the Mysql database normally, until here OK, but when I do unlike the database…
-
2
votes1
answer503
viewsWhich language performs best for the multithread webcrawler using parallelism
I will start a project in which one of the phases will fetch certain information on websites of other companies. Bearing in mind that the webcrawler will go through x sites, and on each site will…
-
2
votes0
answers2482
viewsHow do I use google drive API for sending and receiving audio?
I wanted to know how I can send and receive audio files via Google drive. I never used the Google Drive API, I’m starting now. I did some research on the Internet, but I couldn’t do it. Some…
-
2
votes0
answers103
viewsHow to create a URL Protocol
Well, I would like to know how to create a "Schema", a Protocol like HTTP, HTTPS, FTP. I wanted to know how I can do this Protocol to open a program, like Torrent, with Magnet Protocol. Also, I was…
-
2
votes0
answers69
viewsJava socket not printing what it should
Server: BufferedReader inFromClient = new BufferedReader(new InputStreamReader(connectionSocket.getInputStream())); String s = inFromClient.readLine(); System.out.println("> "+s); This simple…
-
2
votes1
answer333
viewsDoubt validation of Cpf before inserting in the bank
In my class SocioDAO I have the method salvarSocio() which will be saved in the database. In my class DadosUsuario I have the information that needs to be recorded in the bank in case…
javaasked 9 years, 6 months ago Carlos Leandro Ferreira de Alm 339 -
2
votes1
answer203
viewsGoogle api v2, I already have the key, however, provided by third parties, how to enable without SHA-1?
I have a key to enable the Google Maps V2 on android, I did everything I had to do in Manifest and Gradle, when running the request, Fragment appears named Google, however, does not load anything,…
-
2
votes1
answer74
viewsWould it be possible to identify 2 larger numbers in a sequence of 5 numbers typed by the user?
I tried to do, I researched about it, but I could not. I wonder if it is possible to identify two larger numbers without the use of vectors? Follow my attempt: int maior1 = 0, maior2 = 0; for(int i…
-
2
votes1
answer1125
viewsI would like to find the distance in km between two markers how can I do?
I have two markers in this code and I want to find the distance in miles between them. private void setUpMap() { Database_Congregacao database_congregacao = new Database_Congregacao(this); int…
-
2
votes1
answer227
viewsArchive template for Eclipse IDE
Good evening, everyone. In Netbeans, by right-clicking any file you can create a template with the Save as Template option... Does Eclipse have that option? If not, there are some plugin that does…
-
2
votes1
answer79
views$http error with Ionic and spring
have an API with spring framework follows the method below: @RequestMapping(value = "/users", method = RequestMethod.GET) public @ResponseBody ResponseEntity<List<Usuario>> listUsers ()…
-
2
votes0
answers807
viewsGNRE web service status query
I’m having trouble checking the settings of some states of the gnre webservice using the recipe 100099, if you use another recipe (100048 for example), it returns OK, in the case of 100099, it…
-
2
votes1
answer191
viewsHow to convert a String into an id or numerical data?
I have strings that are unique and would like to create an id from it. Does anyone know how I can do? Thank you in advance.
javaasked 8 years, 9 months ago daniel12345smith 2,120 -
2
votes1
answer335
viewsError in multiplication and division (java)
I’m having trouble implementing multiplication and division in my calculator with graphical interface. Regardless of anything I put using any of the operators (/ and *), the output result is 0. Sum…
-
2
votes0
answers220
views -
2
votes1
answer73
viewsMethod call within a class
I have this part of my code where I call a class to add '0' to a character group that must have 4 characters. StringTokenizer frase = new StringTokenizer(IMEIstring,"."); String first =…
-
2
votes1
answer842
viewsAndroid Studio does not display English characters correctly
My project is not displaying any English characters correctly. When I display a string as "no", it displays "no". The strange thing is, when I call the string straight from the res/string.xml, it…
java android android-studio character-encoding configurationasked 9 years, 6 months ago Diego Fortes 357 -
2
votes1
answer331
viewsCreate a web application that runs Junit test cases on java files that will be submitted by a page?
I’m trying to create an application that looks like a judge online, but all I want is that after submitting a java file through an html or jsp page, the application runs a certain Junit test case on…
-
2
votes1
answer206
viewsWebservice consumed via Servlet error 500 Jboss AS 7
Talk, you guys! I have a project, which I decided to divide in two: a core and a web. The core uses CDI with all rules of persistence and business, exposing its functionality via REST and Json…
-
2
votes1
answer250
viewsImplement parent class
Well, I’ve done a lot of research, I have a sense of how it works, but I couldn’t implement it, I’d like a light. I have the classes House and Building, I need to create a father class Immovable,…
-
2
votes1
answer2869
viewsTomcat 9 - #algaworks boot problem
Following #algaworks' book, I tried to install and check the functionality of Tomcat (both version 8 and version 9), and when opening the startup.bat file and accessing localhost:8080 via browser,…
-
2
votes1
answer132
viewshelps in removing a certain string
test content.txt <td><input type="radio" name="pg1" value="SIM" /></td> <td><input type="radio" name="pg1" value="NÃO" /></td> <td><input type="radio"…
javaasked 9 years, 6 months ago Jose Maximilian 773 -
2
votes1
answer54
viewsCheck that Simulated Locations are active
I’m developing an app that will use GPS to record a route. There are applications ( an example ) , which simulate its location. This is done through a development option : I wonder if it is possible…
-
2
votes1
answer200
viewsHow to return the value according to the received parameter?
I had to mock with DAO, but the method receives a spreadsheet object and according to the id attribute of the Spreadsheet I need to return a different value. How do I do this to correctly compare…
-
2
votes2
answers1116
viewsProgressbar loading per Javafx Process time
I have a method that carries a ProgressBar, but it only starts loading at the end of the process, that is after my application finishes generating the reports it starts to be filled. How do I load…
-
2
votes1
answer4316
viewsNavigation between Javafx screens
What is the best way to navigate from one screen to another using Javafx. The way I’m doing every time the first screen calls the second screen the second screen opens with the size of the first.…