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
votes2
answers297
viewsConnect D-link DCS-932L Camera with opencv
I’m trying to connect Opencv with a D-Link DCS-932L IP camera. IP, password, user and port are correct, but nothing works. I believe the error is in relation to the URL format. Below follows the…
-
0
votes1
answer321
viewsChange the color of the List View item if it is disabled - Android
I have a normal listview that lists the names of my users. And I would like disabled users to have the grey background of the list item. How to do this? public class Usuario { private String nome;…
-
0
votes0
answers33
viewsHow to get a variable Inside of thread?
I have a webservice Receiving data and Stores it in a String , how do I get this string Global variables doesnt work! Im using a traditional thread: new Thread() { public void run(){…
-
0
votes1
answer117
viewsNull pointer launch
Is I am using a code in my application that was working normally, but suddenly when I went to test with the emulator gets launched null pointer error on line 32, and also the method definirVolume()…
-
0
votes1
answer208
viewsQuery in HQL using Hibernate
How to do a query to return the result below in HQL Upshot | quantidade | quantidade erro | desc | | 2 | 1 | TESTE 1 | | 3 | 2 | TESTE 2 | | 1 | 1 | TESTE 3 | Table | DESC | ERRO | | TESTE 1 | 0 | |…
-
0
votes1
answer670
viewsUsing Dropbox as a repository for Netbeans 8 projects on Windows
I am using Netbeans 8 in my projects and would very much like to use Dropbox as a versioner. I set up the repository in Dropbox but with the project directory in another way. I may be confusing…
-
0
votes1
answer847
viewsChange Dialog title background color
I have the following dialog box: The green part was mounted with a LinearLayout, but the attribute android:background="#77FF77" did not change the titlebar color. Java da Dialog: public void…
-
0
votes2
answers186
viewsHow to modify an existing System.out.println
If I run this code public class main { public static void main(String[] args) { teste(20); } public static void teste(int maximo) { for(int i = 0; i < maximo; i++) { System.out.println(i + " de "…
javaasked 9 years, 3 months ago Lucas Caresia 2,663 -
0
votes1
answer175
viewsJava algorithm, age increase;
I wanted to know how to make an algorithm in which I inserted a year, and the value increased with age, as year 2016=1, year 2017 = 2, in a method. Something like that: int fazAniversidade(int ano)…
-
0
votes1
answer54
viewsNullpointerexception error with class composition
I have a class called Users, which has as attribute an array of type Sensors protected Sensors sensors[10]; It also has the setDescription method public void setDescription (int ind, String…
-
0
votes0
answers27
viewsEclipse how do I add Packages to be imported later and use them?
I am beginner in development with eclipse and java would like to know where I can add several Packages I have in a book to follow the example, where I can add the Packages and then import them to…
javaasked 9 years, 3 months ago Ricardo oliveira da cruz 21 -
0
votes0
answers172
viewsHow to post on facebook with java Restfb?
I’m trying to create an app JavaSE to make facebook posts, but do not know where to start, I was seeing examples, but only found on JSP. How do I login to get the Facebook token? I thought to open…
-
0
votes2
answers12040
viewsHow to store a pdf file in a Mysql database?
I am developing a project and one of my tables in Mysql will contain files .pdf. The table 'arquivopdf': + - - - - - - - - - - - - - - - - - - - - + | numerocotacao | arquivopdf | + - - - - - - - -…
-
0
votes1
answer99
viewsRead inputstream created on another Active
I’m new to programming. I saved an array of strings through FileOutputStream.write() in my MainActivity. I can read the array perfectly through the FileInputStream in Activity itself. To read this…
-
0
votes1
answer864
viewsUpload remote images with Base64 or URL?
What’s the best way to upload remote images to Android? How these great apps optimize these images? In a country where mobile Internet is one of the worst in the world, there is a need not to leave…
-
0
votes1
answer278
viewsAddition of Chart label formatting mask in Jasperreport
I have a chart of lines and on the X axis it displays a series of dates. What I want to do is display date in the following pattern: dd/MM/yyyy because the same one is displaying in the format:…
-
0
votes1
answer514
viewsMy apk Signed does not run on my mobile
I finished a small application that saves notes and I’m trying to generate Signed apk, but it doesn’t work on my phone. I have tested generating a Signed apk from a new project with only a Blank…
-
0
votes1
answer203
viewsHow to deploy a client to a webservice
I would like to know what I should do to implement a client for a webservice in the Eclipse as a Dynamic Web Project. I can’t generate a client, so I have to start from scratch.…
-
0
votes1
answer327
viewsError: 'Boolean java.lang.String.equals(java.lang.Object)'
This is a program, which, behind the calculator, stores files that you think are important. The error message field I believe is not his and the Super SU or Android system, because every time, in…
-
0
votes2
answers135
viewsOutofmemoryerror error while downloading object list
I am with this error when downloading an object from the webservice that has images that are converted to Base64. The point is that if this object is already saved in the local database of android…
-
0
votes1
answer1240
viewsHow to convert Time type to String?
I have a field horaConsulta and I can’t turn him into String DAO stmt.setTime(4, new java.sql.Time(consulta.getHoraConsulta().getTime())); Servlet Time horaConsulta =…
-
0
votes1
answer1412
viewsSearch by date range
How to create a query for the Oracle database by returning a list of orders according to a date range? Follows the code currently used: if (opcaoBusca.getSelectedIndex() == 0) {…
-
0
votes1
answer58
viewsIterate a String array within an object
I built the following object: public class TableHelper { private String TABLE; private String[] COLUMNS; public TableHelper (String name, String[] columns){ this.TABLE = name; this.COLUMNS =…
-
0
votes1
answer1086
viewsAndroid - Return method using thread
Hello guys I am developing an android application that uses the library Volley (google) to perform my requests http. I have a method that returns a Boolean and depends on the return of the request,…
-
0
votes0
answers131
viewsCode runs in eclipse but not when compiles
I’m creating a mod for Minecraft that uses Jruby to run my scripts within the mod. It runs perfectly in the eclipse, but only in it. If I Compile the mod or rotate by gradlew runClient it does not…
-
0
votes0
answers611
viewsHTTP Status 404 Error - The requested Resource is not available on Spring MVC
I have tried several ways to solve this problem, but when I click to the controller to access the url it error. Follow the files Controller package com.br.maco.controller; import…
-
0
votes1
answer265
views -
0
votes1
answer417
viewsHow to use Listactivity with Actionbar?
You can only access a menu ListView who is without the ActionBar by the menu key in the emulator. How to display it? It is necessary to inflate by BaseAdapter? Activity of ListView: public class…
-
0
votes0
answers168
viewsHow can I call a nodejs method in Java code?
I need to use a Node method in a Java application. I can’t use Nashorn because I need Jquery since pure JS doesn’t solve my problem. Since Node allows the use of Jquery, it was chosen, but I cannot…
-
0
votes1
answer974
viewsUsing Ftpclient I cannot send file to FTP server. Problem with permission
I’m developing an android app that accesses an FTP server where I store backup files. I’m using it as a base in that tutorial. The FTP server is Cesarftp. The operating system is a Windows Server…
-
0
votes0
answers273
viewsError when resetting alarm with Alarmmanager right after cancelling it
I have an alarm set to wake up at a certain time and repeat every five minutes. But after a few repetitions, I automatically set the cancellation of the same, that is, call the method to cancel…
-
0
votes1
answer709
viewsStart a Windows 10 service by Java code
In Windows 7 I used the following method to start a Windows service in Java: static final String CMD_START = "cmd /c net start \""; public static int startService(String serviceName) throws…
javaasked 9 years, 2 months ago Renato Pereira 9 -
0
votes0
answers330
viewsAutomatically authenticate using JCIFS in JAVA
I’m building a Java solution where the goal is to be able to get users who are logged in to a Windows domain to automatically authenticate with their Windows credentials when starting a web…
-
0
votes2
answers167
viewsBest Solution for Web Service Rest
I wanted to implement a Web Service that would provide data to mobile platforms (Android and iOS), someone knows the best service I can use for such? I’d rather it be something open source. I was…
-
0
votes0
answers372
viewsTomcat: The server encountered an Internal error that prevented it from fulfilling this request
I’m having problems with Tomcat using Eclipse. First he couldn’t find the Mysql Driver, then I used Class.forName in class ConnectionFactory and now he’s returning to line 52 AdicionaContatoServlet…
-
0
votes1
answer179
viewsError while trying to connect smack to openfire
I am trying to perform a simple example to connect to an openfire server using the smack library 4.0.6 and have the following code: ConnectionConfiguration configuration= new…
-
0
votes1
answer2188
viewsException in thread "main" java.lang.Nullpointerexception
How do I fix this mistake? Java - Exception in thread "main" java.lang.Nullpointerexception at Client.Customer Registration(Client.java:43) at Operations.main(Operations.java:9) Follows my code:…
-
0
votes1
answer73
viewsHow to Apply Loading Large Bitmaps Efficiently
I am using Imageview to upload images because I find lack of memory error found this method, because I am not able to use. wanted a brief explanation where I change the variables available in…
-
0
votes0
answers56
viewsHow to create a search filter for a String?
My doubt: My goal is to create an application that Voce provides search parameters for it and it can present the search result. Like, you have the Akinator app, you give him information and at the…
-
0
votes0
answers332
viewsWhat should I implement to print the user name in a data output?
Follow my code below: import java.util.ArrayList; import javax.swing.JOptionPane; public class Operacoes { int codc, codf, codl; Cliente cliente[] = new Cliente[30]; public Operacoes() { for (int i…
-
0
votes0
answers98
viewsgetId() returning null (AWT-Eventqueue-0 java.lang.Nullexception)
I’m building a basic system that supports the calls of the IT sector. The problem is this: as it is already in the title, the getId() method of the sector entity is returning null. Seeing this, I…
javaasked 9 years, 8 months ago Cássio Linden Albert 1 -
0
votes2
answers1896
viewsHow to get the description of an Enum in xhtml?
I need help to resolve a situation with an Enum class along with the Dampelle framework. Ex.: I have this class: but I would like the descriptive Ex.: Ordinary Law to appear in my combobox, and not…
-
0
votes1
answer295
viewsXamarin error: Could not create the Java Virtual Machine
I’m having a designer startup problem wanted to know how to solve this problem Could not create the Java Virtual Machine Screen image:…
-
0
votes2
answers96
viewsJava Lang Array Error
Good afternoon, I’m adapting this code to make the search based on an automaton. The automaton will search for dates in the source codes of the Internet pages and will display these dates on the…
-
0
votes1
answer293
viewsList View and Normal Layout in an Activity
Hello, I’m wanting a screen to have a button and, below that button, a list with several items. But it turns out that the buttons are multiplied. Behold: Activity.xml <?xml version="1.0"…
-
0
votes0
answers86
viewsError when trying to access another screen using a Boot
My problem is this, I have my main screen that contains a button to access another screen, the code I’m using to make this call is: btRegister.setOnClickListener(new View.OnClickListener() {…
-
0
votes2
answers113
viewsList method for null returning jComboBox
Hello! I’m having trouble listing my BD data in a jComboBox. The method I use is as follows: public void setComboBoxSetorChamado(List<Setor>setores){ idSetor = new int[setores.size()+1]; int i…
-
0
votes3
answers958
viewsANDROID: How to identify user screen density?
I want the application to just download the images that are adaptable to the user screen, such as: if the user device supports xxhdpi images, it will not be necessary to store the images of xxxhdpi,…
-
0
votes1
answer5041
viewsDetermine time and date of installation of an app on Android
It is possible to obtain the date and time exact that your user has installed the application? On iOS7+, you can get a receipt from when the app was downloaded using [NSBundle appStoreReceiptURL].…
-
0
votes0
answers58
viewsDoubt on the screen creation of a web java application
hello I am new in the branch of progam I am finishing the course now I would like to know if in a web application has as strip that browser bar where you type the url command and too where refreshes…
javaasked 9 years, 1 month ago mikael rodrigues 21