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
votes0
answers117
viewsProblem to save with Hibernate, verified type is different from expected
I’m having a problem saving two tables (@OneToOne) in the bank using Hibernate. Using weak relationship entities (person, address). Errors shown on console: Initial Sessionfactory Creation…
-
0
votes0
answers591
viewsinclude java text field (textfield)
I want to add this text field at my game. I’ve changed the code in my game but this one text field is being opened in a new window, but I want that text field is included in the game window itself.…
javaasked 9 years, 4 months ago insyspower 183 -
0
votes1
answer137
viewsChange and delete objects before persisting in BD
I have a feature that aims to register clients, in which within such registration I have a relationship as follows: A customer may have multiple "Attendances", and each service may contain several…
-
0
votes1
answer163
viewsDo not display another row in the table when status equals "Canceled"
I have a <p:dataTable> which is populated by data that is in a file .xml and I have in front of each line a button to finish or cancel the process. How do I not display more in my DataTable…
-
0
votes0
answers43
viewsError trying to update with Maven
I am having error after setting in the file pom.xml in the artifact <artifactId>maven-compiler-plugin</artifactId>. This is the mistake when trying to update Maven: Could not update…
-
0
votes1
answer710
viewsCapture information and use when you need Java
I am thinking of implementing a function that captures the logged in user, I still can not imagine how I can implement such a function, I would like to know what is usual and propitious for me to…
-
0
votes2
answers261
viewsPreparedstatement is not working
Code I’m using PreparedStatement i = conexao.prepareStatement("INSERT INTO teste VALUES (player='teste', level_1=0, level_2=0, level_3=0, level_4=0, level_5=0, level_6=0, level_7=0, level_8=0,…
-
0
votes1
answer131
viewsRun external command in Java with syntax
Hello, I’m using a DOS file to unzip files. zip, is UNZIP.EXE itself (DOS executable) I am mounting the code as follows: Desktop.getDesktop().open(new File("e:\\unzip.exe teste.zip" )); It does not…
-
0
votes0
answers40
viewsNo Session found for Current thread
I am having trouble performing a test to add a user with profile! My problem is the method addUser. Code of the test class: public class AddUser { public static void main(String[] args) {…
-
0
votes1
answer88
viewsHow to implement this class in a Textview , so that it works correctly?
I found this code for "self-sealing" on the link https://stackoverflow.com/questions/5033012/auto-scale-textview-text-to-fit-within-bounds and would like to know how to implement in a TextView. ** *…
-
0
votes0
answers300
viewsHow to return data with JSON?
I have the following code: wd.setUrl("http://www.cordeiroit.com.br/SOUPROGRESSO/Ctrl/ServerUsuario.php"); wd.setMethod("new-usuario"); wd.setName(campoNome.getText().toString());…
-
0
votes0
answers311
viewsHow to bring data from a JSON webservice on Android
I wanted someone to explain me how to do this.. I have the following code in PHP and wanted to bring to Android, returning the name of the person. It could be in an Array... The problem is that I…
-
0
votes2
answers1505
viewsObject of a class in another Java class
Hello, There is possibility of having the class Object you instanced in the instantiated class? Ex.: (Incorrect syntax, just an assumption) public class Classe2 { // Metodos e vetores da classe }…
-
0
votes0
answers44
viewsProblem in a "self shrinking" class
I asked a question of how to implement this class "self-sealing" but I have this problem when it will start to decrease the text , it is as it truncated the text, then you will be typing it will…
-
0
votes1
answer159
viewsJtextfield validation
I’m trying to validate the field txtServicoValor who gets a guy BigDecimal, follows my code, the validation is barring both the correct form of the digits and the incorrect, I appreciate the help.…
-
0
votes2
answers474
viewsSockets in java
Implement a Java program that waits for network connections directed to port 13131 and, depending on information that will be transmitted to you through the aforementioned connection, perform movie…
-
0
votes0
answers57
viewsChanging the background of android via java
I have an app in mind, but I don’t know how to do its main function. Need to change the background of the home Android system (not the application) through the application. Ex the user clicks on a…
-
0
votes1
answer332
viewsProblem when doing String Code and Discovery
I would like to know why such methods do not behave in a way that: long2str(str2long(String s)) == String s public long[] str2long(String s){ final byte[] authBytes =…
-
0
votes0
answers111
viewsXml components are not loaded into Activity
Editing: I just found out that if I comment on the lines that cause the error, it gets all black screen... IE, does not load the layout. I’m trying to get a Progressbar and a Textview so I can make…
-
0
votes1
answer42
viewsProblem with data change class
I am trying to change data from my BD via Java application, but when I run the following code I get the error (You have an error in your SQL syntax; check the manual that Corresponds to your Mysql…
-
0
votes0
answers282
viewsHow do I get the same browser answer using java/socket?
The thing is, someone already had to make a request http-post implementing socket java? I need to make a request on the site http://spys.ru/en/ and take the Sponse to mine some proxys. However, I…
-
0
votes0
answers89
viewsListener on a button inside a notification
I’m making an app that plays a radio stream, and when it starts playing, I create a custom notification with 2 buttons, one to pause/play and one to remove the notification and stop the stream, but…
-
0
votes0
answers56
viewsQuestion about android default to communicate with other Activitys
I have an Activitymain, it starts at the beginning and only ends its activity at the end of the application, that is while browsing other activitys of the app this Activity will always be behind. My…
-
0
votes1
answer264
viewsError with Actionlistener
import java.awt.Color; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.File; import…
-
0
votes0
answers271
viewsProblem installing Jasperreport Server 5.6.1 on Windwos 8.1
Good night! I am having trouble installing Jasperreportserver 5.6.1 on my Windows 8.1 with Java 8. I downloaded the Jasperreports Server from the link jasperReportsServer . I downloaded the…
-
0
votes0
answers30
viewsHow to pass values from one Activity to another
I came here to know how I do to pass data from one Activity to another, I’ve tried this: Intent i = new Intent(this, other.class) i.putExtra("NAME", name); But when I try to take the other Acticity…
-
0
votes0
answers193
viewsHow to transform a piece of text into an image
I have 1 string in java that is receiving 1 json array , which has several images together with the link of the respective ones, I have another string that has text and within that text there is X…
-
0
votes1
answer926
viewsHow to select a particular java listview line
How do I get the line id of a listview? The idea is this: before picking up the selected line, I’ll work with all the lines I’m trying. aList = new ArrayList<HashMap<String,String>>();…
-
0
votes1
answer592
viewsOperations with Hashmap
Good afternoon guys, I need to do some operations using Hashmap. I am new in the area. I have the following map protected Map<String, Map<String, Integer>> elementos = new…
-
0
votes0
answers32
viewsHow to put an image in a string
I wonder if it would be possible to load an image inside a string in android through an image url? .
-
0
votes1
answer51
viewsReplace a text with an image
I wonder if it would be possible to give replace of a piece of text by an image that is made through URL? I want to replace image 1, image 2 and image 3 with images that are in a JSON array , what…
-
0
votes0
answers64
viewsThrowable error returns null
I have a problem I need to receive the memory stream of a webservice that was developed in C#. The following routine worked correctly, but now it keeps falling in the catch and the exception comes…
-
0
votes2
answers4028
viewsClass.getResource() can only recover files in internal folders to which the class is located?
In this class, I need to read files *.properties that are in another project folder/package. The folder structure is this: util properties (here are the . properties) util server queries (here is…
-
0
votes1
answer59
viewsFill in form with customer ID
I have a form with customer ID, customer name, address and email. As the ID is only wanted that when the input of the ID is filled in, do a search in the database and complete the rest of the form…
-
0
votes1
answer44
viewsJasper report complaining of non-existent property
[RESOLVED] Guys, I have a report and I come across the following situation: java.lang.NoSuchMethodException: Unknown property 'acompanhamentoPorObra' on class 'class…
-
0
votes1
answer448
viewsProblems upgrading from access token
I’m authenticating the Google Calendar API using Scribe, which uses Oauth 2.0 instead. Authentication is completed successfully but I don’t know how to store the access token (accessToken) in the…
-
0
votes0
answers390
viewsTextfield Null in Javafx
I’m learning to develop in Javafx. I would like to be able to select an item in a tableView, when clicking a button, it opens a window with the details of the previously selected item. But I am…
-
0
votes1
answer474
viewsHow to read a PDF containing accented characters using iText?
I am trying to read a PDF using this iText library, however, accented characters are ignored, I have already looked at the project Encoding and this as UTF-8. PdfReader reader = new…
-
0
votes2
answers1501
viewsError - HTTP Status 404
I’m having trouble with Tomcat my test site. When I enter it gives an error: HTTP Status 404 - /Liferay/ type Status report message /Liferay/ Description The requested Resource is not available.…
javaasked 9 years, 10 months ago Rodrigo Rafael Varela 1 -
0
votes1
answer228
viewsUsing Multiple Threads to Run a Faster Build on Maven
What the Maven offers in terms of parallelism for the execution of builds? If I execute one build in a machine with more than one processor, how can I take advantage of more resources for…
java maven multithreading parallelism continuous-integrationasked 9 years, 3 months ago Filipe Miranda 3,138 -
0
votes1
answer181
viewsJavafx Webview does not receive 200 messages from AJAX
I am using the Restlet library that allows you to use Restful services without needing an external server. Webview and Browser Code: public class View extends Application { public static void…
-
0
votes2
answers671
viewsIn java, how to make only one Jframe window close when clicking on the x instead of all?
I’m making a program in Java with multiple windows JFrame, and wanted that when I pressed the x of one of the windows only this one closed, instead of all of them.
-
0
votes1
answer145
viewsMonitor Directory with Java Web
I’m working on an application Java Web, using the server Apache Tomcat and I need to monitor, or "listen" to a directory on the server. Asynchronously, and permanently. Because when a file is…
-
0
votes0
answers257
viewsPrint selected nodes of a Jtree
I got this Jtree: I have this code that returns to me all the nodes of JTree: public void print() { recurse((TreeNode) jTree2.getModel().getRoot()); } public void recurse(TreeNode theNode) {…
-
0
votes2
answers85
viewsProblems with Insert in an Android project in Java
I am new as Java programmer for Android, I am creating an application that he register an email, in the image below he will register the email and above the user will login. But when I try to…
-
0
votes1
answer484
viewsDoubt with Notification and Alarmmanager
What I need is a hint, help to know how to implement an Alarmmanager that whenever a notification appears something like this In the Home screen of the phone and is making a sound every 5s for the…
-
0
votes1
answer1267
viewsFloating point format in java
Personal how do I read a floating point with a specific limit of decimal places after the comma? For example, read 3.14? Note: I know you can format the value of a variable with decimal format, but…
javaasked 9 years, 3 months ago Dan Lucio Prada 772 -
0
votes1
answer175
viewsLabel’s and/or Textfields do not appear in subreports in Jasperreports
I have a report with sub-report in jasperreports, the problem is that when I run the report it is not displaying the contents of the Abels or textfields that I put in the sub-report, someone has…
-
0
votes1
answer223
viewsWeb service does not access my classes
I am building a web service, previously it was already working normally but the scripts were all in one package, so I decided to organize in different packages my scripts however now my web service…
-
0
votes1
answer469
viewsHow to take dice from a Fragment and play in an Activity?
I have a class in java that takes all the information and assembles the entire structure of my program. Well, as I do to pick up an Edittext that is in my Ragment and play its content inside the…