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
answer3888
viewsHow to get latitude and longitude without internet on Android?
How do I get latitude and longitude in Java to the Android without using the internet, only with GPS. I think there is some way yes, because the application "Maps" of Android does not use the…
-
0
votes2
answers231
viewsWhat annotation is used in Ormlite mapping for Enum as Foreign?
I have the Client class and the Animal Award, where a customer can have 1 or more pets. I would look like this: @DatabaseTable(tableName = "cliente") public class Cliente{ @DatabaseField(generateId…
-
0
votes1
answer163
viewsProblems with Android Studio
Today I migrated to Android Studio, I was using until today Eclipse + ADT to develop for Android. So I gave the run in the application and gave this error: the module cannot be android library I…
-
0
votes1
answer618
viewsHow to Capture Usage Time of Apps Installed on Android
I wonder how I could capture the usage time of all apps installed on Android. There are some apps that do this in the Play Store. I have been doing several searches and found that there is a code…
-
0
votes2
answers1367
viewsLocked socket when performing data exchange
I am trying to carry out server and client code in Java for the client to send a String, the server process and return it and the client receive. The customer is kept always listening. But after…
-
0
votes1
answer1079
views"Lookup failed" error when using a Glassfish Custom Resource
I’m using a Custom Resource of Glassfish to save a property: There, I’m trying to take this amount like this: new InitialContext().lookup("javax.faces.PROJECT_STAGE") but I get the following…
-
0
votes1
answer2195
viewsHow to sort and disarray a JSF datatable by clicking on the column?
Good guys, I have an application in JSF, I would like to know how to sort and disorganize datatable when clicking the column, in this table there are 6 columns and 3 of them I would like to click it…
-
0
votes1
answer462
viewsImage Servlet for JSF Project "Locking" the Application Server
I have the following code that provides my portal with the images that are in the database @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,…
-
0
votes3
answers902
viewsPass value to a java function
Hello! in Javascript to pass a value to the function I do: <button onclick="myFunction('valor')">Click me</button> and crawl like this: function myFunction(a){alert(a);} and in java on…
-
0
votes1
answer210
viewsExplanation about a JSP command
I have a command line in my JSP code that I can’t understand type StringUtils.isBlank I know it’s a condition, what I don’t know is what’s inside. It follows part of the code:…
-
0
votes1
answer1887
viewsHow to customize java.io.Ioexception error message on Android?
When Android makes an external connection and this url is not available it returns an error. How to customize an error as in the example below: java.io.IOException: Error response: 401 Service…
-
0
votes1
answer276
viewsProblem with class org.hibernate.Validator.Invalidvalue when upgrading from Hibernate 3.X to 4.X
I have a project developed using Jboss Seam 2.2.2.Final along with Hibernate 3.6. I’m trying to upgrade this project by upgrading and migrating the component versions that it uses. One of these…
-
0
votes1
answer634
viewsAndroid with external barcode reader
Hello, I have a screen with fields for typing and a specific field where I will use the external barcode reader. The problem is that the scanner disables the virtual keyboard. Any idea how to leave…
-
0
votes1
answer53
viewsFragmentactivity in tab Swiper
I’m not getting to insert a Fragmentactivity for tab Swiper: @Override public Fragment getItem(int position) { switch (position) {case 0: return new HomeActivity(); case 1: return new…
-
0
votes1
answer179
viewsSending of Android SMS
I’m developing an android app for sending automatic Smss. When I send many Smss around 200 at the same time the phone turns off and presents the following error in the log: display Event receiver…
-
0
votes1
answer216
viewsEclipse Windowbuilder Pro - Export Project
I’m having trouble exporting my project with icons. 1º Export -> "Runnable jar file" 2º I leave the first option marked. 3º When I run on Linux or on another machine other than mine the icons are…
-
0
votes1
answer155
viewsHow to compile Java with icons
Formerly, post a question of how to compile my project in "Runnable Jar" with icons. And manage to do this with label and Buttons. Now my doubt is how to do this in iconImage. I tried the following:…
javaasked 10 years, 4 months ago Júnior Nascimento 679 -
0
votes2
answers691
viewsReading properties file
How do I read data from a file properties on Android? Follows my code from onCreate: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
0
votes1
answer2398
viewsProblem when calculating average
I’m trying to make a program, which gives the grade of two tests, P1 and P2. You sum and divide by 2 to get the average. If it is larger than 6, the program returns the following sentence: Approved.…
-
0
votes2
answers4752
viewsRun a precedent from a Java application
I have a file inside the oracle database, but I would like to run it from a java desktop application that I am developing. How do I run an oracle protocol with java parameters?
-
0
votes2
answers695
viewsJava - Mysql Export and Import DB
Good afternoon. I created a DB in Mysql named Pizzeria. I have tried various means of creating DB backup but haven’t had success. The last code I tried was: try { File file = new File("Backup");…
-
0
votes1
answer991
viewsSend image to print automatically from web app (html, js and php)
Hello, I have a webapp where I take a photo with a frame for a badge and save it on the server, but I needed to have this image print automatically, ignoring that prompt that appears when we have…
-
0
votes2
answers220
viewsHow to use a Rails cron job to run a program in Java?
Is it possible to use a cron job in Rails to execute a command that runs a class in Java? If so, how?
-
0
votes1
answer201
views -
0
votes1
answer119
views -
0
votes1
answer560
viewsHow to display items from an Arraylist by an array?
I came up with a code here, it’s like this: class Main { Lista lista = new Lista(); public static void main(String[] args) { i = 0; String[] vetorExibir; lista.exibicao(vetorExibir = new…
-
0
votes1
answer633
viewsEclipse error does not meet JVM
Hello, I use Linux Mint 16 and I installed the eclipse and I circled quietly, but after the eclipse installation I uninstalled Openjdk 1.7 and installed Javajdk 1.8. edited the file /etc/profile by…
-
0
votes2
answers239
viewsTwo Android Progressdialog one after the other
How do I display two Preview Dialog, when one is finished, open the other? In my case the user clicks a button, then several files of a folder are moved and renamed to another folder, it first sends…
-
0
votes0
answers149
viewsError while trying to trigger Facebook Share on android SDK
I’m developing an android app where the person can login through Facebook. I am trying to develop the option "share" so that an application message can be posted on the user’s timeline, but I am…
-
0
votes1
answer1709
viewsHow to determine the size of a Jtextfield?
I’m doing a program involving the Pitgora theorem, and I’d like to leave a triangle in the middle, with three Jtextfields around the three sides of it. I did that, but the problem is that when I…
javaasked 10 years, 2 months ago Isaac Reinaldo 127 -
0
votes1
answer5030
viewsJava check, show values recorded in Mysql database
I need help I’m making a game in java and I need all records and files and player etc in my table but I can not connect with the database and much less check and display values Ps: sun.java tutorial…
-
0
votes1
answer2623
viewsMoving circle on the screen with thread and jFrame’s Paint method
Studying the design method of JFrame in case the paint and wanted to make a circle move on the screen using threads, but the circle does not move right. Perhaps you would need a method movimenta to…
-
0
votes0
answers25
viewsHow to create an Activity for a single?
How do I rescue the sqlite data and send it to the xml single? My Sqliteopenhelper: // Getting single Contact getSingle(int id) { SQLiteDatabase db = this.getReadableDatabase(); Cursor cursor =…
-
0
votes1
answer170
viewsShow View as slide
Hi, I would like to know how to make a View appear as slide on an android layout changing the size of your siblings, for example the information of a point in the Google Maps app that appears and…
-
0
votes1
answer172
viewsSimplecursoradapter java display images
How do I display the images in the layout with Simplecursoradapter? My code . java: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
0
votes2
answers160
viewsNullpointerexception when creating a View on Android
I’m creating a Activity on Android, whose code is here, and I’m getting a NullPointerException near the line final TextView txtResult = new TextView(this); I got the following dump from the stack:…
-
0
votes1
answer143
viewsScript code function
Could someone explain to me what the part that says means in this code: document.cookie = 'useHTML5=; expires=Thu, 01 Jan 1970 00:00:01 It appears more than once, I wonder if it is something related…
-
0
votes1
answer359
viewsjava.lang.Runtimeexception: Unable to start Activity Componentinfo java.lang.Nullpointerexception
Hello, I’m new to android and when I try to run my application appears these following mistakes: 08-15 18:10:49.828: E/AndroidRuntime(1769): FATAL EXCEPTION: main 08-15 18:10:49.828:…
-
0
votes1
answer95
viewsUnable to read Beyond the end of the stream
I was trying to create a socket connection between Java and C#, Java being the client and C# the server. But when I use Binaryreader to read the data, it returns an error: Unable to read Beyond the…
-
0
votes1
answer947
viewsSetting an image as a background in JAVA ME
How do I set an image as a background in a JAVA-ME application?! I have no idea how to start this, I’m new to Java. This is the Class that takes care of the graphic part: /* * To change this…
-
0
votes1
answer200
viewsSwap attributes from one Object to another
In my java application I have a declosed object like Extrair extrair = new Extrair(); And I use this object and its attributes for my Serrvlet. But I need to pass this object to .jsp. In jsp I use…
-
0
votes1
answer439
viewsOffline database
I’m creating a program that uses a database on file. I was told that the Sqlite is for this, I can create database with it and access by file. In that case, would I use the SQL or JDBC library to…
-
0
votes1
answer99
viewsHow to enable auto-complete in Declarative Views in the Crux Framework?
When creating a new project (or even when I import existing projects) in Eclipse, how can I enable the auto-complete function of the components in the views? I have to import some catalog, or this…
-
0
votes1
answer61
viewsAccessing the server via linux
I would like with my Java application (netbeans) to access the database that is on the server, but this has become complicated, because it is through a Linux machine. Could someone explain to me how…
-
0
votes2
answers1994
viewsHow to decode a JSON array [{},{}] on my android
How I turn this string in an array on my Android so I can manipulate it? [{"id":"1","login":"Admin","senha":"Admin","nome":"Admin","msg":"Eba","logado":"0"},…
-
0
votes1
answer126
viewsRemove Actionbar Tabs indicator on Android
For default Actionbar tabs comes with the blue indicator (how much is selected) and my question is how do I remove this blue indicator. I intend to use icons in these tabs, but as it is shown the…
-
0
votes1
answer615
viewsApplication migration error, ANTLR and Wildfly incompatibility 8
I have a legacy application developed in Java web, and would like to put it in a new production environment. Java 8 and the latest version of Wildfly are installed in this environment. Today this…
-
0
votes1
answer409
viewsDaughter entity does not receive its parent entity merge id via @Cascadetype
I have a problem when adding an entity to the database via Cascade. After the update of the entity Aluno the entity Daughter NivelAlunoLinguaEstrangeira does not work properly. @Entity @Table(name =…
-
0
votes1
answer104
viewsMore efficient way to use "Expression" in enhanced "for" cycles
Among the following forms, which the most efficient? ... //assumindo que o método pegaListaPessoas() pesquisa na base de dados todos as pessoas for (Pessoa pAux : pegaListaPessoas()) { //executo…
-
0
votes1
answer1481
viewsHow do I get foreign key values on a Jframe form
I am creating a form in Jframe to insert data into a table that contains two foreign keys (since these keys are not generated automatically). What I have to put on Insert to get foreign keys? public…