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
answer42
viewsHow do I set certain array values for the same value? (Java)
Example, I have a two-dimensional array of type int: int array[][] = new int[10][10]; How do I define the value of, for example [2][3], [6][7] and [1][9] for some same int, without needing to define…
-
0
votes1
answer165
viewsAndroid - How to transport picture information from one class to another?
Hello, I need to transport the contents of an Imageview from one class to another, I tried by Intent, but I couldn’t get through it. I have a Drawable that was edited in Imageview of the first class…
-
0
votes0
answers220
viewsExtract JSON data on Android received by Datasnap
I have never worked with datasnap do not know how to extract! Someone can give me a help, I leave the code I have: DSRESTConnection conn = new DSRESTConnection(); conn.setHost("54.207.112.131");…
-
0
votes1
answer67
viewsPlay Framework TDD exception testing routes
I am studying the Play Framework with Java and in the documentation there is an example of route testing at the end of this page: Doc Play Framework But when trying to run the test he answers me…
-
0
votes0
answers573
views -
0
votes1
answer47
viewsError closing Intent.ACTION_VIEW
I preview an image with Intent.ACTION_VIEW and when closing the following error occurs, I’m guessing it is in Mainactivity.class: E/AndroidRuntime: FATAL EXCEPTION: main Process:…
-
0
votes1
answer172
viewsReturn person and phone list
I have an entity called Pessoa. This entity has a phone list of the entity Telefone. How do I bring the person information and popular the phone list of this person in a select with only hql? When…
-
0
votes2
answers804
viewsJava jsf image
I am wanting to place an image on a netbeans JSF page, but the page does not display the image. I’m calling the picture in my code like this: <h:graphicImage library="resources/imagens"…
-
0
votes1
answer196
viewsCreating Project Grails at Intellij
I’m having trouble creating a Grails project at Intellij. I tried with multiple versions, 2.4.4, 2.5.0, 2.5.6 and all the same error occurs while sending the run-app command: |Running Grails…
-
0
votes0
answers55
viewsFlipper with text on Android (Android Studio)
I am creating an app in Android Studio and would like to know if there is any way to do a back and forward by swiping your finger (Flipper I think) calling the next text. So far I already have…
-
0
votes0
answers184
viewsINFO: Error Parsing HTTP request header
When submitting a form, I was testing how much information I can send via HTTP. I am using Mysql DBMS. I have an application that runs several textarea fields. Example: a form with 10 textarea (I…
-
0
votes1
answer45
viewsUsing Media in Android Studio
Hello, good morning. I have an audio in the raw folder, a few seconds long. I want to use this audio when the application opens. When the app starts, it will already start with the audio playing.…
-
0
votes1
answer73
viewsError in android application when searching data in postgresql database via Webservices with Ksoap2
First I made a Webservice Using Axis 2, where it has the class connected with the database, and the class with ordering ADO with CRUD. Using the Soupui, I can carry out the method calls. So far so…
-
0
votes0
answers71
viewsUpdate information for p:painelGrid in real time
I need to make a screen with real-time information that will run on a TV for 24 hours, seven days a week. I studied some ways to make, using Restful and Primefaces components, such as the…
-
0
votes1
answer100
viewsOdd results when calculating factorial
I can’t find the error in my code. When I put numbers smaller or equal to 12 my program gives the right result, but from the number 13 the values come out wrong and I can not know why. What’s the…
-
0
votes1
answer505
viewsSave Intellij Project as . java
I started a week ago a programming course, but I’m not in the IT area and the like that is making my learning difficult. I wonder if there’s any way you could help me with this first obstacle of…
-
0
votes1
answer105
viewsModify a Linkedlist using another Linkedlist
I have a List1 and a List2. List1 is very large and List2 has some elements of List1. To avoid searching the entire List1 to make a modification and thus lose performance, I need to have a List2 in…
javaasked 7 years, 5 months ago Marcos Vinicius 41 -
0
votes1
answer51
viewsgetResources(). getDrawable(R.drawable.my_icon) obsolete, how to proceed
Hi, I’m having trouble with the fact that getDrawable is obsolete. Please, how can I convert my code so it can be updated? I thank you in advance! int height = 100; int width = 100; BitmapDrawable…
-
0
votes0
answers291
viewsDoubt How to Recover Data in blob format and display in jsp
Good Staff I am with a very critical doubt I am not managing to recover the data from a field of my database that has the format blob I read some documentations but I could not understand very much…
-
0
votes2
answers240
viewsJDBC, query returns false but saved in database
I am running the following java function: public boolean insert(User user) throws SQLException{ String sql = "insert into usuarios (nome, email, senha) values (?,?,?)"; PreparedStatement instruction…
-
0
votes1
answer255
viewsUsing Gson instead of Jackson in web service that makes use of Jersey
I found out that Jersey by default makes use of the Jackson framework for resources to return data in Json format. However, I had the need to use the Gson framework to convert objects to Json. How…
-
0
votes1
answer104
viewsPrime faces,play data from a datatable for a dialog
screen contact <?xml version="1.0" encoding="utf-8" ?> <p:growl autoUpdate="true"/> <p:panel header="Formulário" id="panel"> <h:panelGrid columns="2"> <h:outputText…
-
0
votes1
answer723
viewsAdmin permission to run netsh in java
In a java program I developed, I need to open connection on port 21 (ftp) but Windows 7 by default blocks this port. I tried to add a rule in the firewall allowing the connection using…
-
0
votes0
answers37
viewsCharacter removal on Heroku server
I have the following code snippet for special character replacement public String removerAcentos(String str) { return Normalizer.normalize(str.replaceAll(" ", ""),…
-
0
votes0
answers47
viewsLong-time running integrity of Java application
I have tested my Desktop application, and noticed that when I leave running for a long time I notice changes in the behavior of the actions that should be performed. My application runs using…
-
0
votes1
answer1784
views"is not a valid java home jdk"
I’m trying to install Weblogic 12c from a . jar. I execute the command java -jar wls_121200.jar , but CMD returns to me This installer must run using the Java Development Kit (JDK), however, C:…
-
0
votes0
answers559
viewsHow to generate/send (Server-Side) JSON via Java and receive via Jquery (Client-Side)?
I’m having trouble exchanging information between my web application (client) and my application java on the server side. I am trying to query the server via JQuery and hoping to receive as a return…
-
0
votes4
answers6374
viewsEncrypt Java password with Hash sha256
i need to compare the password that the user is placing on a login screen with the one saved in the database, I found that when the user is registered is used to hash sha256 to encrypt the password,…
-
0
votes1
answer70
viewsIndexoutofboundsexception in reading an Inputstream
follows the excerpt of the code I am studying: FileInputStream stream = new FileInputStream("/home/rafael/2015.json"); // esse aquivo tem 24 bytes byte[] result = new byte[(int)…
-
0
votes1
answer159
viewsWhat is the explanation for the following question
This is a matter of the simulated java certification of the Whizlabs site. public class Whizlabs { public static void main(String[] args) { int[] testData = {1, 2, 3}; for(abc){ } } } The question…
-
0
votes0
answers93
viewsAndroid - How to send an Audio to an FTP server?
I’m creating a Mural where people can send text and audio messages to a php server, text messages and the wall work perfectly, but I have no idea how to store a recorded audio and send it right…
-
0
votes1
answer1364
viewsError installing Netbeans 8.2 on Windows 10
# # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000744b6adf, pid=9300, tid=0x0000000000002364 # # JRE version: Java(TM)…
-
0
votes0
answers39
viewsProblem assigning an Arrayadapter inside an Onclick container
Method: spnCondPagamento.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { List listaCondPagamento = new ArrayList<>(); for (int i = 0; i <…
-
0
votes1
answer463
viewsusing Entitymanager to return a List
Guys, I’m having a problem at the bank looking for a list of phones, these phones have to belong to a number. in my query I do this public List<Telefone> buscar(Proprietario proprietario) {…
-
0
votes1
answer458
viewsFragment with recyclerview closing application
Let’s go I need to make one fragment where information will come from little to little, I am using the method of RecyclerView to develop this. The whole idea is to get comments from a certain item.…
-
0
votes1
answer1064
viewsConsuming REST in Wordpress
Good morning! I implemented a Rest API with Spring and would like to consume it on a site within Wordpress. This is done through Plugins or direct with code within the Post? For a Post Request, how…
-
0
votes1
answer643
viewsLoad Json Search in JSP
Good Morning I’m trying to make this example in my project. It’s a simple change of Select when you choose State Change Cities in another Select. https://gist.github.com/ografael/2037135 But I can’t…
-
0
votes1
answer38
viewsFaulty Service problems on my web service
made a web service and was working perfectly until this morning, in the afternoon when I put to work the webservice through Eclipse and tried to connect at the same address occurred an error Faulty…
-
0
votes0
answers38
viewsJavascript not recognized by Chrome
I’m having problems using Spring MVC, Google Chrome and Javascript. Every time I create a new Javascript file, in my project using Spring, the browser does not recognize this file. I’ve cleared the…
-
0
votes0
answers231
viewsHow do I list an Arraylist within a Jlabel
Person would like to know how to print an Arraylist inside a Jlabel, I am using Joptionpane but it shows one element at a time would like to show all the elements in a single window. Follow the code…
-
0
votes1
answer2159
viewsAdd items dynamically to a list using Thymeleaf
In my application, I have a form to add an object to the database. In this object I have a list of other objects. For example, it is as if the object I am registering is a Sale and the list is…
-
0
votes1
answer215
viewsHow can I "keep" data from an Activity when rotating the screen?
I have an Activity that makes an HTTP request using Asynctask, the result of this request is sent to a method that updates my UI. But when I rotate the screen, the data populated in Textviews is…
-
0
votes1
answer134
viewsHow to open a new Activity without closing the Drawer menu?
I have an Activity and in this Activity I have the Drawer menu. How do you call another Activity without the Drawer menu disappearing? I just want to change Activity’s content. I tried to use…
java android android-layout android-fragment android-activityasked 7 years, 4 months ago Lucas Charles 127 -
0
votes2
answers1156
viewsSpring MVC and UTF-8
I’m making use of Spring MVC in a project, running on a Glassfish server and having trouble displaying text on JSP pages that contain special characters such as accents. I tried to put the charset…
-
0
votes0
answers41
viewsActivity enters onPause only the first time it is called
I’ve got a Pedidocad Activity calling a Productocons, following code to open Productocons: Intent intent = new Intent(PedidoCadActivity.this, ProdutoConsActivity.class); intent.putExtra("activity",…
-
0
votes1
answer90
viewsComparing data returned from BD
I have a problem which is this:: When reading the data from a given Firebase node, I get an undetermined String number. The name of each String, is the ID of the User. When returning this data, save…
-
0
votes1
answer146
viewsProblem opening Ireports sub-report on another terminal
I created a report that searches for information in a sub-report to show all information. But when running on the development machine it appears without any problem either in the IDE or by running…
-
0
votes0
answers20
viewsHow to put a Listview Expandable in a Tab?
Opa, I cannot configure this type of listview in a TAB. For example, I have screen 1 when I click the button on screen 1 it goes to the screen I want to put the tab (with name of college campuses).…
-
0
votes1
answer148
viewsFree DB for distribution together with commercial application
I had been reading certain licenses of some SGBD software along with the BD itself and a very confusing doubt arose. The Mariadb (Free version) it is open-source, but I could distribute it, along…
-
0
votes1
answer1419
viewsHow to Get a json list of a JAVA Api?
I have the following return of an api {"type":"champion","version":"7.10.1","data":{"89":{"id":89,"key":"Leona","name":"Leona","title":"a Alvorada…