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
answer498
viewsPrime number algorithm only works for the first verified number
I created a program to check primes and in it I receive n entries. That is to say, n is the number of test cases. The problem is that in the first test case everything works fine. Already in the…
-
1
votes0
answers28
viewsRunning multiple instances of the same application on a single Memcached Server
I’m having a problem with "docked" and Memcached apps, to store some values, apparently when I start a new instance of Docker, which runs a Spymemcached client, all the data in the cache is…
-
1
votes2
answers839
viewsHow do I get the Wi-Fi network name (SSID)?
I want to make an app that takes the information of the Wi-Fi connection, that the mobile is connected, being more specific I want to make an app that takes the name (SSID) of the Wi-Fi network in…
-
1
votes1
answer176
viewsTimertask Error: Looper.prepare() not called
I got this mistake. Can’t create Handler Inside thread that has not called Looper.prepare() The goal is to repeat the function that receives the map every 1000 thousandths of a second. Timer t = new…
-
1
votes0
answers30
viewsPick up current cell phone position by Location
Guys I’m trying to make an app to track the phone (get the current position of the same), the problem is that I don’t know how to do. I need the phone to take its current position (longitude and…
-
1
votes2
answers1283
viewsJava socket issues, how to send and receive messages simultaneously between client and server?
I am working with java sockets and I was able to come across the following problem, writing the server class sent a message to the client to read, so far everything, ok!! But when I try to send a…
-
1
votes1
answer73
viewsSave a Textview value and add another
I’m Creating a keyboard to add value to a Textview. I was able to add a value only to Textview. But what I wanted to do was keep the current value and add another to the side so that the user can…
-
1
votes1
answer38
viewsIn this case below, wouldn’t the login attribute have to be set as private for the method?
I am studying inheritance in Java and one of the exercises has the code below, I think, the login attribute would not have to be set as private for the method? public class Gerente extends…
-
1
votes1
answer120
viewsWhat comes after POO?
I am finishing the course of POO in Java and would like to take a doubt. So far I have not been given anything regarding how I could put a desktop development for third party use. For example, on…
-
1
votes3
answers169
viewsHow do I identify the method or command in the code to display a data list in Navigationview?
I found this code on hithub about an embroidery viewer follows the project link, I tried to look in that app where is invoked method or command to display this data list follows screen prints to…
-
1
votes1
answer184
viewsLook and Feel in java
I have an application that uses Windows Look and Feel. However I have a problem where the user can have a computer with Windows XP, and everything is stylized with windows XP. It’s like the…
-
1
votes1
answer561
viewsPersist associative table in manyTomany
I have the following problem: How will I persist in an associative table that has no class ? I have two classes: Person and Time, where I want to make the relationship between people and teams. In…
-
1
votes0
answers188
viewsRemove pdf image using itext
I am adding image in pdf with itext, but in some moments I need to remove this same image.. How do I do this so as not to corrupt the reading of it? I have tried some ways, as follows:: The first…
-
1
votes0
answers18
viewsAndroid - Textview displaying letters gradually
How do I make a Textview display the text gradually, showing letter by letter? I searched the internet and found some tutorials on Typewriter effect, but I could not use. main.xml: <TextView…
-
1
votes1
answer140
viewsHow to call in Fragment a component and its Activity properties?
I needed that when I entered the Fragment he executed this method Verifcar() in main Activity to check the condition and not show the RecyclerView. Mainactivity.Java public void Verificar(){…
-
1
votes0
answers70
viewsaddView(View, Layoutparams) is not supported in Adapterview when accessing "Home" activity
I am developing a shopping cart for Android using Firebase and I am having problems using Recycleview since the activity is crashing after user login, producing the following error. Log 05-24…
-
1
votes1
answer89
viewsListview error with Arrayadapter and Custom View
I’m looking to make a product listing, where each line contains more than one information per line. The problem is that the app throws exception (I believe) and closes when I click the button that…
-
1
votes1
answer174
viewsHow to configure Jboss AS 7.1 with Demoiselle 2.4.1 to operate with distributed transactions?
Hello My scenario: JSF/Demoiselle application that invokes an EJB method, both hosted on a Jboss AS 7.1.1 server. During Insert and update operations on a CRUD page, the Demoiselle application has…
-
1
votes2
answers416
viewsAlertdialog button to confirm ERROR
My friends have a problem, I tried to understand how Alertdialog works, where the focus was to create two buttons to confirm the dialogue. The code I’m using is this: import android.content.Context;…
-
1
votes1
answer83
viewsAndroid - Run function with seconds delay
My question is: how do I get one function to run seconds after another? Mainactivity.class public void onClick(View p1){ //quero que essa função seja executada primeiro…
-
1
votes1
answer101
viewsIcon gets small in notification
I have a simple notification, but the icon does not fill the whole part. I generated it through Android Asset and put each resolution in its respective folder in mipmap. Notification Android 4.1…
-
1
votes1
answer85
viewsInjecting dependencies beyond Activity and Fragment?
It takes something special to inject a dependency with Dagger into an Android project other than Activity, Fragment, Service etc???? Example, if I have: Activityman -> Fragmentlistcake ->…
-
1
votes1
answer41
viewsProblem to link Jframe to main
I want to start using Jframe, I have a petshop program (very simple) that I can, including client, include animal, do service, consult client and exclude client. wanted to make a menu for it using…
javaasked 6 years, 6 months ago Daniel Döbereiner 15 -
1
votes1
answer213
viewsMy app that has Listview with Arrayadapter is closing when creating the list
I’m looking to make a product listing, where each line contains more than one information per line. The problem is that the app throws exception (I believe) and closes when I click the button that…
-
1
votes3
answers5196
viewsHow to set up a timer in Android Studio to perform tasks at constant intervals?
I am developing a simple application with Android Studio and need to create a timer to run some methods every 1 second. I tried it this way but it didn’t work: int delay = 1000; int interval = 1000;…
-
1
votes1
answer117
viewsDrawerlayout - control visibility
When the app runs the first Drawer displayed is correct; it only comes with a visible option item. This option when selected activates an Activity that is running normally but at the end of its…
-
1
votes1
answer981
viewsDoubt about how to fill two-dimensional array in Java
I’m doing an exercise and I need help. That’s the statement: Calculate average temperatures for each month. For this, create a list containing the names of each month in the rows, and the number of…
-
1
votes1
answer46
viewsRemove objects that are attached to the list of others
I have a problem removing an object. What is happening: I have two tables -> PROCEDURE and SECTOR: I can create normal sectors, save, edit, delete and add procedures to the list of each created…
-
1
votes0
answers49
viewsExample of Navigation Drawer
How do I add a Navigation Drawer to a Activity? I searched several sites but only found the projects to download and not the explanation of how to do it.
-
1
votes1
answer1153
viewsFill text field with return from another window
I have a JTextField instantiated in the class time relay. By clicking on that JTextField, he calls another JFrame search. When performing a search on this new JFrame and click on Confirm, I need him…
-
1
votes0
answers69
viewsReceive FCM messages in Java application
I’m researching about Firebase Cloud Messaging in order to use it as a messenger on a platform where there will be web systems (Java, Spring) at one end and in the other App s (Ionic) - both…
-
1
votes0
answers94
viewsJava - Apache POI for Excel
I need to extract the information from an Excel file (xls) in Biff4 format, and Apache POI, although it is great for reading Excel files of version 97-2003, does not help much with these older…
-
1
votes1
answer39
viewsProblem with controlling connections with the Bank
I am having some problems connecting to the database. Follow my code and the exception. Code @Repository public class MinhaClasseDAOImpl implements MinhaClasseDAO{ protected EntityManagerFactory…
-
1
votes1
answer1094
viewsShare object between two controllers in Angularjs
I’m studying AngularJS and I’m trying to make a CRUD simple, however I am not able to have the same object of my listing for my form, that is, at the time you click the edit button go to the form…
javascript java angularjs angularjs-scope angularjs-factorysasked 8 years, 4 months ago Felix Ferreira 13 -
1
votes0
answers249
viewsRedirect Servlet to JSP by passing data
I’m doing a library project, I register Book, Publisher and Parents and then I display them on JSP. When I register the data appear normally in JSP but if I refresh the page they are re-registered.…
-
1
votes2
answers43
viewsError logout cookie Servlet
Hello. I have a line error: Cookie cookie = new Cookies(req.getCookies().getUsuarioLogado(); The complete method/class is this: @WebServlet(urlPatterns = "/logout") public class Logout extends…
-
1
votes1
answer55
viewsJson via POST giving error
Hello! I am sending a Json through an Httpclient and it is returning an error about header. Does anyone know what might be? JsonDeDados = sender.sendMessageDATA(); List<NameValuePair>…
-
1
votes0
answers42
viewsCustomer asking the same amount 2 times
I am making a distributed system, and the customer is asking for the same amount several times. Follows class Cliente: import java.awt.HeadlessException; import java.rmi.Naming; import…
-
1
votes1
answer504
viewsHow to retrieve IMEI from mobile programmatically?
so, I need to recover the IMEI of the phone that is using the app, I tried to use some old methods, but I always get the warning that the method was deprecated...could help me? Grateful from the…
-
1
votes1
answer162
viewsProblem trying to transfer files using Apache FTP implementation in Java
I am performing file transfer via FTP using JAVA. I’m using the classes Ftpclient and Ftpserver apache. In a specific environment, sometimes files are not transferred. I call the method…
-
1
votes1
answer62
viewsSQL function with mysql
I am implementing a function for a vendor search field and my sql function is in trouble, would anyone know what problem? This was a function of when using postgree, but now I’m using mysql. package…
-
1
votes0
answers41
viewsorg.apache.axis2.databinding.Adbbean cast error
I am trying to make a conversion of a system that is in java 6 that is working perfectly, but after switching to maven3 and java7 gave error in a part of the system that I am not realizing the…
-
1
votes0
answers29
viewsProject migration done in Eclipse to Android Studio - FATAL EXCEPTION
I made the import and I had no mistake, more when I try to compile the project I have this problem: 07-13 15:29:13.786 1380-1380/br.com.sistemaguardiao E/AndroidRuntime: FATAL EXCEPTION: main…
-
1
votes1
answer59
viewsI’m having a problem with reading a string variable in java
I created a variable of type string and it is not reading a sentence with line break, this simply jumping, in java there is a way to clear Buff as C or something that can do? code snippet: Scanner…
javaasked 6 years, 5 months ago Nathan Silva 87 -
1
votes1
answer221
viewsHow to reset Inputstream
I have a Webservice that saves the photo in a folder of the server that was sent by the Android application through the following code: ... int read = 0; byte[] bytes = new byte[1024]; OutputStream…
javaasked 8 years, 4 months ago Reginaldo Rigo 3,638 -
1
votes1
answer2561
viewsHow to catch an http GET replay using Httpurlconnection java.net?
I have the following class: package com.akamai.edgegrid.auth; import java.io.*; import java.net.*; public class C { public static String getHTML(String urlToRead) throws Exception { StringBuilder…
-
1
votes1
answer54
viewsThread independent from the result
I have a query where returns a list of results; Example: 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 I would like from that list to create a thread for each one independent. For each to do their…
-
1
votes1
answer240
viewsAccess attributes of type Object
I’m having trouble accessing values from an Object attribute. I have a No class that has No attributes, and Object Item. Each item is an object of the Subject class. I queue the items of the class…
-
1
votes1
answer91
viewsClass javax.annotation.Nullable not found
I am using JDK 8 and I need to use the library javax.annotation.Nullable, but the eclipse returns an error saying that there is no.. Does anyone know how to get it or what version of JDK contains…
javaasked 6 years, 5 months ago Adryan Alencar 51 -
1
votes2
answers696
viewsCalculate the smallest element of a list
Given a sequence of integers (read via Scanner), determine the lower of these values. My code: import java.util.Scanner; public class MenorValorSequencia { public static void main (String args []) {…