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
-
1
votes0
answers239
viewsHibernate Query with setParameters
Hibernate is ignoring my data from a Map when it is void. If I’m with setParameter("nome",valor) and the value is null it works, does anyone know how to solve? Follow the code: public List…
-
1
votes0
answers402
viewsJava Vehicle Card Validation
Someone already knows how to validate the new vehicle plates? Vehicle plates should start using Mercosur standard 6 months from now Instead of 3 letters and 4 numbers, as it is today, the new plates…
-
1
votes0
answers1168
viewsProblem with Spring Tools Suite
I am starting my studies with Spring and downloaded the Spring Tool Suite version 3.9.4. to develop java web applications. I had previously installed JDK version 8. I am using Ubuntu 18.04. Given…
-
1
votes1
answer468
viewsFill table with data entered in Jtextfield, separated by comma
I have the code under a JTextField, where you wanted to type numbers separated by comma, and that by clicking on JButton, data were added in a table column. public class Dados extends…
-
1
votes1
answer512
viewsAndroid - Hide Actionbar buttons
I made a code for a button to be pressed to display an Edittext. But I only managed to hide the title and icon of the application. So how do I hide the buttons too? Mainactivity.java: package…
-
1
votes1
answer119
viewsHow to use different implementations from the same interface
I’m having trouble understanding the diagram and specifications below. How I do the method double getCalculaFrete() return the same value returned by the method double calcularFretePedido(), being…
-
1
votes1
answer190
viewsClose System after Dialog Close
How can I make a login screen when it is closed, also close the whole system? In the code below I have a main screen with the button "change user", when clicking, the system opens a Dialog for the…
-
1
votes1
answer95
viewsError while trying to run Scene
I made a screen with Scene Builder, but when I compile in Javafx gives this error could help me? ant -f C:\\Users\\gusta\\Desktop\\TccProject\\LoginJAVAFXML jfxsa-run init: Deleting:…
-
1
votes0
answers21
viewsSet field to search on a Spinner
I need a research field on top of mine spinner not to use the on-screen scrolling and save time for the user. Thank you. Code in which the spinners are executed: public class FormularioMateriais…
-
1
votes0
answers719
viewsWhen receiving notification from Paypal with payment status, it gives error 500 when pushing on my API
The code below is the PUSH created for Pagseguro to send me the notification of the status of my payment. But the error returned is 500, and in their forum no answers so far. Someone who has been…
-
1
votes1
answer460
viewsJasper with JPA connection
I’m in a Java Desktop project using JPA, just to send a few reports where I’m using Jasper. Reports have sql queries the user interface will only pass parameters for data filtering. I found it…
-
1
votes0
answers228
viewsassign a list object as an attribute of another class
I am importing data through txt file, and I have enclosed in this class that has two attributes of type object, supplier and product. When I read the txt file, I pass as parameter only the code of…
javaasked 6 years, 4 months ago Daniel Genaro 19 -
1
votes1
answer76
viewsAndroid - Detect specific word in an Edittext
How do I make it so that when a button is pressed, it activates a function only if a specific word has been typed at any position in an Edittext? Thank you. main.xml: <EditText…
-
1
votes1
answer447
viewsData Structure, Circular Queue. Questions about the Queue and Queue methods
I’m not getting the two blocks else in the methods Desenfileirar and Enfileirar. More specifically the lines: this.tras = (++this.tras % this.info.length); this.frente = (++this.frente %…
-
1
votes2
answers95
viewsHow to readjust text that is inside a Textflow?
I have a problem, where, when trying to readjust the screen, the text that is inside a TextFlow, goes off the screen, and it’s not set down. public SwingFXPanel(ServicosJson json) { this.json =…
-
1
votes1
answer174
viewsData Structure, Double Chained List. Doubt about the Double List Constructor
Note: Code taken from a Data Structure booklet. Why not pass the number of nodes from the Double Chained List by its Constructor (as in Stack or Queue structures)? public class ListaDupla { private…
-
1
votes1
answer245
viewsRelationship of one column to several
I have an entity class called Doctor, in which it has an Idmedic column. It relates to the class entity Care, which in turn has an Idmedico column, which would be a foreign key of this first. There…
-
1
votes2
answers139
viewsCode problem in Java
I am doing a program in basic Java. At the moment there are 6 classes, however, you are having problems in 2 classes at the time of registration. I’m making a SET to register the name of the player…
-
1
votes1
answer133
viewsHow to know which is the last item selected from a listview?
Hi, I have a ListView using the simple_list_item_multiple_choice, filled with a ArrayString of all Brazilian states. I need to fill the following SQL command with all the states selected by the user…
-
1
votes2
answers883
viewsRead lines from a TXT to Arraylist
I need to read a log saved in a TXT file that contains geographical coordinates in the following form: -54.123440,-21.123456 -54.123425,-21.123467 -54.123435,-21.123480 -54.123444,-21.123444…
-
1
votes1
answer113
viewsJavafx - locked screens
All Javafx screens lock when the server is turned on. I tried to use task, but you don’t seem to be getting ahead of yourself. The program works even with the locked screens but I would like to be…
-
1
votes2
answers151
viewsDoubt call method with If Java
Well, I’m doing a college project and I’m starting now in java, the question is this, I have 2 tables in sql server and 2 distinct classes in java, which would be physical person and juridical…
-
1
votes1
answer409
viewsBrowse Hashmap with equal values
I am developing an application in Java Web, where it contains several CRUD’s. I need to perform some validations of some values I have stored in a Hashmap. How do I go through it and see if the…
javaasked 6 years, 4 months ago Rafael Luz 49 -
1
votes0
answers22
viewsJaas does not work with tomcat7 Maven plugin
I’m using the JAAS for the safety of my webapp. I declare only one JDBCRealm of the normal Tomcat, passing the bank credentials... follows the context.xml with the Declaration of the Realm: xml…
-
1
votes2
answers114
viewsIs it worth measuring performance between Java x Kotlin applications?
Going through the Google Developers documentation, I found something pretty cool like: Measure app performance with Android Profiler But knowing that Java and Kotlin are interpreted by the JVM, I…
-
1
votes2
answers364
viewsControl of Rest application transactions in spring
I was studying a little bit on the note @Transactional (version made by Spring), and I came up with a doubt. According to a published in Devmedia, to "more correct form" to use is to write down in…
-
1
votes0
answers69
viewsCompare two hashmaps
Hello, I need to buy the values of 2 Hashmaps. I’m making an Image Matcher using equal amount of colors, using this code, but I don’t know how I can compare them. public static double…
-
1
votes1
answer496
viewsHow to recover an object from a Hashset
I store my vows within a HashSet, but I would like to do a vote count in a Result class. How do I retrieve these votes and group by quantity? import java.util.Collection; import java.util.HashSet;…
javaasked 6 years, 4 months ago I. Oliveira 27 -
1
votes0
answers43
viewsCombo product and play value in inputText
I am developing a DOCUMENT registration with parameters such as Material, Name and other data. And how it will work, before performing a normal PRODUCT registration with parameters of Material and…
-
1
votes1
answer187
viewsClose a Dialog When you click the back button
I would like the open Dialog to be closed when I click on the return button of the mobile phone. I know that to close a dialog we use the Dismiss, but I don’t know how we declare the back button of…
-
1
votes1
answer35
viewsJAVA Nullpointexception
by clicking on my button in the view the parameter is not arriving in my attribute java responsible for the button public Map<String, Object> getFiltroGlobalMap(){ Map<String, Object>…
-
1
votes2
answers418
viewsAndroid - Scratch text on a Listview
I created an application of tasks to be done that are presented in a Listview. I am using Sqlite with a table with the columns: ID, task, completed. I want that when I go through the records, if the…
-
1
votes0
answers46
viewsProblem to sector setImageResource
Hello, I have a project to which I upload drawable images to a Listview, the problem is that when I run the project no seated images appear, someone can help me find the error? LAYOUT main_activity…
-
1
votes2
answers183
viewsInstantiated object does not appear in function
Hello, I am creating a Java project using Eclipse with windowbuilder. Inside this project I have Jframe with the objects, jbuttons, jtextfields, jformattedtextfields, etc... I have all these objects…
-
1
votes1
answer286
viewsJAVA - Database connection - Sqlexception error: Parameter index out of range
Hello! I’m new to Java, and I came across this problem: Netbeans accuses that I am not respecting the SQL parameter limits, but are correct. Part of the error in question: Testando conexão com banco…
-
1
votes2
answers352
viewsDifficulty with nested FOR loop
I am creating a code to develop my studies in java and gave me an idea/ interesting challenge: One person has 5 Megasena cards and always plays with the same cards. I made a little code where you…
-
1
votes0
answers187
viewsConvert PDF to Word without losing styles
Wanted a code to convert a pdf document into word without losing the styles. I have this class that converts to word but it doesn’t keep the document styles. public class teste { public static void…
-
1
votes1
answer272
viewsProblem with Feign Client
Good afternoon I have a small problem connecting to another API with the feign client, what happens that testing locally works, when I go to production that it simply gives a notfound. Code of Feign…
-
1
votes1
answer56
viewsError while instantiating in Java
In my course on Java OO, I have assembled a class to perform certain functions. But always return Nullpointexception. If I do the same thing main, without creating any class, everything works in a…
-
1
votes1
answer89
viewsWork using Thread
I’m doing a college paper who has to be used thread. But I’ve never used it and I’m still learning it. My intention is, when you press the up key on the keyboard, startar to thread to make an event.…
-
1
votes1
answer64
viewsPass JSP Objects with Hibernate
Expensive, I have the classes below. I am having trouble creating a tree classification, because in JSP I am passing the parameters "Id Area" and "Tree Description", in the controller I am receiving…
-
1
votes2
answers351
viewsProblem with string comparison
I need to compare if the name typed in textField is equal to the "root" user. At the time of comparing even typing root the Eclipse informs that it is invalid. Unfortunately I don’t understand the…
-
1
votes1
answer141
viewsHow to show only folders in Jfilechooser?
I have a JFileChooser and I need it to show only folders, but I can only show at least one type of file or show all types. Follow example code where I restrict to a file type: package NewClass;…
-
1
votes1
answer26
viewsCan’t my client find my Httpserver?
That’s my client code: public static void main(String[] args) throws IOException, InterruptedException { SendData sender = new SendData(); String JsonDeDados; String infos = "informacoes";…
-
1
votes1
answer46
viewsI’m Having Trouble Opening a New Activity after taking a photo with android studio
Code public class primeiraTela extends AppCompatActivity { ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
1
votes1
answer30
viewsWhy does my client only submit two requests?
My Httpclient is only sending two requests. The server receives, returns the 2 values but it is actually a loop that sends a lot of times! Can someone help me? public static void main(String[] args)…
javaasked 6 years, 4 months ago user115863 -
1
votes0
answers202
viewsDraw a Jpanel inside a Jframe
I’d like to know how to draw a line inside a JPanel which sits within a JFrame, by pressing a button. The layout of the button and the JPanel within the JFrame is shown in the image below: When the…
-
1
votes0
answers109
viewsConvert Publish JAVA key encryption to C#
I need to send a hash encrypted in c# but the API so me this possibility in java, has how to follow this logic and apply in C# ? try { try { cipher = Cipher.getInstance("RSA/None/PKCS1Padding",…
-
1
votes0
answers208
viewsHow to receive messages from firebase console on android in the background?
I have an app that sends notifications from the firebase console and my notifications don’t arrive on my phone when they’re in the background but when they’re in the foreground with the app open the…
-
1
votes0
answers267
viewsRegister certified "https" protocol for SOAP(Axis 2) request
I created a service to register the "https" protocol and inject the certificate into it using the Socketfactory implementation, but it works well only one request at a time, but when using…