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
-
2
votes2
answers375
viewsHow to insert a jTabbedPane into a jPanel of another class
How can I add a Jtabbedpane of one class to a jPanel of another class? Possible? In the 'Confempresa' class I created a container and added Jtabbedpane which is called 'jTabConfEmpresa'. public…
javaasked 10 years, 1 month ago Hugo Machado 866 -
2
votes2
answers329
viewsHow to know when two Threads ended up in Swing?
I have a method that performs two tasks. I would like two threads perform each task. Tasks do not share data, are completely independent. Before starting the tasks is shown a dialog with the…
-
2
votes2
answers3012
viewsHow to go through the values of a Hashmap through a certain key?
How can I traverse the values of a Hashmap through a certain key? An example to illustrate: I have a Hashmap called values, with a key that is an id represented by String and a value that is an…
-
2
votes1
answer194
viewsList coming with null value
Well, the thing is, I have three methods that are called init() of my Bean, only one works and the other 2 comes as null, I’ve already debugged and in my Product the data is correct, but when I…
-
2
votes1
answer106
viewsDemoiselle update to JEE7
The Demoiselle framework has greatly increased productivity here in the company. However, it is being a limiting factor in the use of some new technologies, especially related to JEE7. My projects…
-
2
votes1
answer269
viewsListing internal memory files in Listview
I intend to create a app that by clicking on "Lists" create a list using ListView based on files found in a particular internal memory folder(path).
-
2
votes1
answer176
viewsHow to keep SDK and JRE Java installed and updated in a windows development environment
How to maintain a secure, clean and up-to-date java installation (SDK and JRE) of Java on a computer used for software development? I’m having trouble maintaining my development environment because…
-
2
votes1
answer191
viewsPassing data from one txt to another txt
I have a file .txt with three names separated by comma, in this case: test.txt João,Maria,José In my class I take the file and pass to a array, separating by comma: String nomeArquivo="teste.txt";…
-
2
votes1
answer829
viewsEdittext Android Accents
someone there knows how I can and if you can do the following, in my Edittext wish the user could not put accents. In case it would be better to treat the text and remove after typing?
-
2
votes1
answer204
viewsHow to convert numbers 2.15600e+03 (Uler) to numeric type?
I have the following problem: I have to read a file that contains several very large numbers as an example below. When trying to read them and send to a variable double/long/int, the error accusing…
javaasked 9 years, 6 months ago William Pereira 3,998 -
2
votes1
answer4413
viewsHow do I change a java desktop application icon in Eclipse?
You can change the icon of a java desktop application in eclipse instead of the default icon?
-
2
votes0
answers228
viewsParsing an XML and its respective XSD
Precise parse a WADL manually and create an XML with specifications I have here. Example: -> Yahoosearch.wadl file [...] <application * xmlns:yn="urn:yahoo:yn" * > <grammars>…
-
2
votes2
answers2888
viewsHow to use mouse click and keyboard ENTER?
How to include in my class an event that gives me the possibility to click on JButton and he show a JOptionPane? And in the same way JButton, I press the ENTER and he show me the same JOptionPane?…
-
2
votes1
answer2289
viewsCopy page text and paste into another with JAVA or Selenium Webdriver
How do I copy a text from a web page and paste it into an input on another page, with java or Selenium Webdriver?…
-
2
votes1
answer1071
viewsHow to view if there are two identical items in Arraylist and remove them?
I am doing the "Tokenization" of a TXT file. I need the code to hold all the tokens in an Arraylist, but can’t get any token duplicate. I would like to know how to remove tokens duplicates, or…
-
2
votes1
answer475
viewsPolymorphism with Arraylist
I have the Nterface below and I would like to know how to overlay the method by passing another object to List because I have 4 classes in my entity, for example the entity classes are cliente,…
-
2
votes1
answer982
viewsHow to change page after inserting object in database?
I created a JSF page with a client form, after saving client by pressing the sign up button. The object persisted in the BD, and consequently I would like you to change pages going to the…
-
2
votes1
answer83
viewsHow do I create a String template and whenever the user passes something different report the error?
I need a String template that starts with letter, has no space, accepts numbers, is case sensitive, (uppercase and minuscule) and does not accept special characters or accents, (will be the name of…
-
2
votes1
answer112
viewsHow to traverse a vector with the quantity of the second vector?
int[] teste1 = {3524, 79, 2573, -4216, -4126, -4169, 1876, 2903, 2702, 1090, -6544, -8600}; int[] teste2 = {3524, 79, 2573, -4216, -4126, -4169}; I have a vector with 12 records and another with 6,…
javaasked 9 years, 6 months ago Carlos Pereira 1,190 -
2
votes3
answers1805
viewsReturn the inverse of a vector
How do I reverse the values of a vector? Example: 1 2 3 turn 3 2 1 I am currently trying to make a method of the type.. public static int [] vetorInvertido(int [] vet){ int [] vetInvert = new…
-
2
votes1
answer1459
viewsPlace icon inside jLabel on jTextField
How to change the date insertion mode in my jTextField? Here’s what I got: I want to insert this icon that is in jLabel inside my jTextField. Is this possible? Upgrade: import java.awt.*; import…
-
2
votes2
answers2352
viewsError building JSON of an Object recovered by Hibernate
Error building Json of an Object recovered by Hibernate. session.getTransaction().begin(); ArrayList<Cliente> lista = new ArrayList<>(session.createCriteria(Cliente.class).list());…
-
2
votes1
answer1965
viewsUpdate form dialog without closing it
How can I update my form dialog without closing the same? In other words, I need to search the address by the zip code, and throw it in the form, but I’m not getting it. Follow the code I’m using.:…
-
2
votes2
answers1315
viewsConvert Empty string to integer to insert into database
How can I convert an empty text field (Jtextfield for example) to an integer, and then insert it into the database? I have fields in the database defined as int, but when the user does not fill in a…
-
2
votes1
answer947
views(Hibernate2) Genericjdbcexception: Could not execute query - Closed session error while browsing the platform
Good afternoon! I have a web application and decided to migrate it to Cloud Google. When I start my Cat, the application runs smoothly, but from a certain time, starts to appear these errors.…
-
2
votes2
answers2187
viewsExtend findAll with custom filters
I am trying to extend findAll from my JPA repository to make custom filters. I did some research and found some ideas of use with Predicates and the like but did not identify something that worked…
-
2
votes1
answer211
viewsControl java application on the outside
I created a java SE application that runs in the background, without swing or anything... But how do I control this application? for example, in python applications we can execute commands (python…
-
2
votes1
answer111
views -
2
votes1
answer265
viewsHow to place a Mousecliked event on a table using Javafx
I’m trying to put a Mousecliked event on my table but gives this error: java.lang.IllegalArgumentException: argument type mismatch My method is like this: private void…
-
2
votes1
answer478
viewsError org.hibernate.Lazyinitializationexception how to resolve?
I know this error is derived from trying to fetch some data from the database when I have no session open. But the biggest problem for me is that this error is appearing to me completely random, as…
-
2
votes1
answer37
viewsHow to apply a setNull(index,Types.Blob)?
How can I enter null in the database if an image is not loaded? FileInputStream cabecalho = null; conn.setAutoCommit(false); File fileLogotipo = new File(imagemCabecalho); //imagemCabecalho = path…
-
2
votes0
answers139
viewsHow to connect Prolog with c#
I wanted to know how to create a knowledge base in prolog and use it in a interface maid in the c# or java, create new clauses via interface.…
-
2
votes1
answer1878
viewsRun Time Java Method in Time - Run Periodically
How do I run a method of a Java class of x x in x time in Weblogic? From what I have been checking, there is the possibility to use the @Schedule annotation in the method (Java EE 6). But since I am…
-
2
votes1
answer948
viewsWhere to start a system that performs an hourly task
I’m a little confused, where can I start a system that performs a task every hour? Have some framework? The system will be desktop and will run on a Windows Server 2003 server. The idea is that…
javaasked 9 years, 5 months ago DiegoAugusto 8,694 -
2
votes1
answer90
viewsHow do I avoid infinite loopings in an array?
"Mount an F matrix of size n x n representing a forest. Each element of this matrix can have 3 values: 0 - if empty 1 - contains a tree 2 - contains fire With probability p, given by the user, put a…
-
2
votes1
answer764
viewsHow to determine the size of a Jlabel?
I’m creating a program, and I’m making his menu. But to make the menu, I need to create a button and I’m creating this button using images with the JLabel and using the MouseListener. However, I…
-
2
votes1
answer271
viewsJVM instrumentation. Know how many times a method was called during program execution
I have a processing application for batch, currently she is multithreads, I need to know how many times we are running the save method. Would anyone have any idea? Because I need to increase the…
-
2
votes2
answers531
viewsWhat is the correct way to get the device date?
This is a relatively simple question, but one that has broken my mind a lot. I need to pick up the date and time at a certain point in my app’s run, but I don’t know what is the most recommended way…
-
2
votes1
answer435
viewsHow to update a Jtextarea with information from Jcheckboxes?
I am in need of help in the following, I have a window that the user can activate the Jcheckboxes to write in the Jtextarea that is below, as the following image: What I wanted is that when you…
-
2
votes1
answer215
viewsHow to block an item from a listview?
I have a list of Textview in a Listview, and by clicking on one of the Textview I have access to a Fragment. How do I stop, when I’m in one Fragment, the Textview responsible for opening it is…
-
2
votes2
answers1983
viewsBased on a date, know what is the week of the year
Considering that 1 year has 12 months and that each month has 30 days (same February), and that 1 January belongs to week 1 and 30 December to week 52, create a method that when receiving a date (in…
javaasked 9 years, 5 months ago Marcio.Rezende 217 -
2
votes1
answer427
viewsGraphics Generation Framework for a Desktop System in Java
Good afternoon, I’m developing a system desktop in Java and in it I need to provide data visualizations through graphs. I would like to know if anyone knows, has heard or has used any framework for…
-
2
votes1
answer1930
viewsCalculation of hours with Java 8
I was doing some tests with Java 8, and I was trying to calculate the difference between times of two dates. I did it in three ways, but I don’t know which one would be the right one and I’d like…
-
2
votes1
answer258
viewsHide Actionbar in one Ragment but show in another
I am working on a project that is being done virtually all based on fragments. So far, I’ve only got one activity and 4 fragments, within which I need only one of them not to have the ActionBar.…
-
2
votes1
answer2128
viewsError: "Lock Wait timeout exceeded; Try restarting transaction"
I’m developing a java application that uses Hibernate to do the mapping. I created the DAO’s of the classes, but when doing Insert, update and delete operations it returns me this Mysql error.…
-
2
votes1
answer193
viewsIs there any way to add more than one mask to a Jformattedtextfield?
I have JFormattedTextField for a price attribute'. In it I say that its format is "R$ #####,##". However, as I do not yet know how to add events (I am learning) I would like right away if it is…
-
2
votes1
answer122
viewsWhich method can I use for the edges of Jbutton do not appear?
I think the question already describes it all: Which method can I use so that the edges of my JButton are transparent (not shown) in Java?
-
2
votes0
answers287
viewsElectronic Invoice in Java
I have a web system in java that controls the sale of pharmaceuticals and now I need to implement Nfe in this system. I wonder if there are any courses, libraries or even some example where I can…
-
2
votes3
answers658
viewsBusiness rules in JSF
In JSF where would be the best place to define business rules? In the model, in the Managed-bean or in a layer of business rules( I am very reluctant to adopt this last approach), or even to…
-
2
votes0
answers79
viewsMaven UML Generator
I wonder if there is a more current plugin to generate the UML of my classes in a Maven project. The idea would be to run this "uml Generator" engine on the integration server continues, and so…