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
votes1
answer315
viewsHow to capture colors from an image on a Jlabel that behind another Jlabel?
I need to get the pixel colors of an image inserted in a JLabel with MouseMotionListener, and this Jlabel is under or behind another Jlabel. I know it is possible to get a background color behind a…
-
1
votes0
answers365
viewsAndroid Alertdialog
Good, I’m developing an Android application and right now, I found a problem for which I can’t find a solution, I’ll probably be doing something wrong, I hope someone can help me. The problem is…
-
1
votes1
answer94
viewsHow to do tabbedPane concealable?
I’m having trouble trying to make a tab (tabbedPane) that is displayed according to the status of a Checkbox ("selected/unchecked"). I do not know if it is possible, since it will end up changing…
-
1
votes1
answer1048
viewsHow do I make the program change the scene based on one button action in Javafx with Scene Builder?
Hello, everyone. I am trying to create a game in which the first window displays 2 buttons. One must activate 1 player mode and the other 2 players mode. When one of the modes is selected I intend…
-
1
votes1
answer91
viewsError with Arraylist data display
While recovering data from an arraylist by means of the "for" command, it displays the following message: Note: I could not identify where the error is. What do you think is wrong? package…
-
1
votes1
answer105
viewsCharacter array does not save correctly
I’m making a program to encrypt according to Caesar’s Cipher in Java. I came across the following problem in code: package projects; import java.util.Scanner; public class Projects { public static…
-
1
votes0
answers198
viewsAndroid Retrofit 2 Simple XML Converter Response
I am using Retrofit 2.2.0 and Retrofit Simplexml Converter 2.2.0. I added the simplexmlconverter at the time of the retrofit with the addConverterFactory method. The problem is that when I get the…
-
1
votes1
answer192
viewsGoogle maps' getMap() problem - android
I am studying the google maps api and was using it as a basis for my video studies available on youtube. However, while I was studying I came across a code depreciation problem. The video class that…
-
1
votes1
answer1834
viewshow to rescue a data list and view in jsp
Good evening, I am unable to display a list that is saved in the database on the jsp page. I would like to know how I do, have tried some ways, call for menagerBean and Servlet jsp calling on…
-
1
votes1
answer137
viewsHow to make Inserts in table creation in Sqlite?
I would like to know how to do INSERT manuals in the Databasehelper class that extends from Sqliteopenhelper. public class DatabaseHelper extends SQLiteOpenHelper { private static final String…
-
1
votes1
answer135
viewsProblem inserting Jtextfield inside Jpanel inside Jtabbedpane
I have a Swing app where the main window consists of a JtabbedPane which contains some extended classes JPanel [Viewprincipal, Viewcadastro, Viewrelatorio, etc...]. When I add Jlabels and Jbuttons,…
-
1
votes1
answer667
viewsValidate Jdatechooser
I am having trouble determining if the user has filled in a date field of type JDateChooser, would like to do a validation, to know if this empty or not. I tried to do by looking at the…
-
1
votes1
answer196
viewsAccess the service layer from the controller
Hello, I am developing a REST web service that queries Apache Solr data. I am using Spring boot + data with Solr repositories. I don’t know how to connect the service layers, respository and…
-
1
votes1
answer434
viewsWeb View with zoom
I have a web view being loaded onto the screen (mounted by an internal HTML) which sometimes opens with zoom and others without the zoom. I don’t want her to open with zoom, I need it to open on the…
-
1
votes2
answers112
viewsUse same sorting algorithm with different attributes
Setting: I am developing a small application as a task of my course. As the intention of the work is precisely to show what we learned during the classes, I can not escape much of what I already…
-
1
votes2
answers99
viewsDatatable data is not displayed, even with loading of Arraylist running correctly
Guys, I am loading a JSF datatable with an Arraylist, but the result is not displayed in any way, follow as my code: index.xhtml <h:body> <h1>Novo Jogo</h1> <j:form>…
-
1
votes1
answer168
viewsDoubt about parallel programming
I’m starting to learn parallel programming, and I’m looking to compare a program with a single thread with a multi thread. What I thought was to make a very simple algorithm that, in a 1-minute…
-
1
votes2
answers1024
viewsHow to Sort List (Hibernate)
How can I order a List with java and Hibernate? I have an abstract class with this method public List<T> listarContas(String where) { String consulta = "FROM " + entityClass.getSimpleName()+ "…
-
1
votes1
answer782
viewsHow to read xml for object with Xstream
I have a relationship of 1 to n from product to historical , that is, a product has several months/histories. How to read the following xml for Object? <produto> <descricao>PAVESINO…
javaasked 7 years, 5 months ago user2509556 403 -
1
votes2
answers313
viewsButton locked in while
My program has a loop, created with the command while. I start the loop with the start button. However, I can’t do anything else in the program while the while is spinning. I wanted to put a button…
-
1
votes1
answer1239
viewsHow to change the color of a Jtable’s lines?
I need the line color to change whenever the cell value is 0. However, all lines are being painted. View with a simple Jtable import javax.swing.JTable; public class View extends javax.swing.JFrame…
-
1
votes1
answer303
viewsError when comparing an Edittext to a String
I am trying to compare the text inserted in an Edittext with an item in my Arraylist, but the condition is never true. int aux=-1; for (int i = 0; i < lista2.size(); i++) { if…
-
1
votes0
answers711
viewsexecute CMD command through JAVA
I am having trouble executing a command in CMD through JAVA. This command is executed by a . jar that lies inside a directory "C: Copyutility Copyutility.jar. So I need to enter this directory and…
-
1
votes0
answers72
viewsConfiguration in Webview
Good afternoon, I have an application ( in Xamarin for android) where within it opens a webview on a link of a platform courses I have... but there is a big difference between I open this platform…
-
1
votes1
answer157
viewsDeploy Heroku Maven project with multiple modules
I have a Maven (web) project composed of a packaging project (packaging = pom) and several modules. I want to deploy that project in Heroku. Doubts: Where should get the Procfile? In the packaging…
-
1
votes0
answers60
viewsForeign Ireports Key: java.lang.Classnotfoundexception: br.com.tkcsapcd.model.bean.Projectnew
I have an error when compiling the report in Irepor, the first time I compiled it worked, however, when I closed Ireports 3.7.3, and opened again I tried to compile, the error below: Compiling to…
-
1
votes1
answer430
viewsMethod being called several times in the change event of a p:ajax
I have a table with a p:inputText with a p:ajax inside, the same holds the event change, when I fill that inputText with a value a query and some validations are performed. The problem is that when…
-
1
votes1
answer1160
views -
1
votes1
answer107
viewsEncrypt password in groovy
I am developing an application that will have a login screen that will be based on data (user, password) already saved in a database Mysql, and so I thought I would apply the same Hash which was…
-
1
votes1
answer651
viewsTranslation app Text to Speech - Android
Hello, I’m beginner on android and would like to make a simple translator, where the user write anything and click the button with the desired language to translate aloud, how would be the…
-
1
votes2
answers47
viewsError to popular array with Double
I need to put in a array of double the quantity field data coming from the database. By doing this with the following code: static List<Historico> listaComCincoUltimosMeses = new…
-
1
votes1
answer745
viewsCreate a graph from values of a calculation
I am with the following doubt, how can I make my dynamic graph ? I have a graph, which is formed by two values, I want that according to the result any calculation, it changes/alters its…
-
1
votes1
answer197
viewsUpload file/parameters via HTTP in Java
I was using Python to update some equipment via Post, where I defined some parameters and sent a file, where the equipment itself updates after receiving this file. However, as I developed a Java…
-
1
votes1
answer365
viewsRender table cell image size
I created a java table that shows my images stored in blob in the database. However the height of the table is not automatically resized having to put a value manually, for example:…
-
1
votes0
answers43
viewsPassing data from one view to another
I am trying to implement the following function, when the user clicks the edit button, it would send to the page "create" only populated. but when I try to do so, he sends but with nothing. in my…
-
1
votes2
answers467
viewsAuthentication screen with Sqlite
I have to authenticate the user, but when I inform the user and the correct password he enters the menu screen, so far so good. The problem is that when I type an incorrect password or user, I want…
-
1
votes2
answers227
viewsReturn all birthdays of the month chosen by the user
I’m developing a system of an agenda of friends. Some classes have been created: Endereço, Amigo, GerenciarAmigo. When I put the system to run, it doesn’t show me the String of the birthday names of…
javaasked 7 years, 4 months ago Davi Fonseca 11 -
1
votes1
answer720
viewsDisplay specific error! java.sql.Sqlexception'
Hello I am as following code: <c:set var="exception" value="${requestScope['java.sql.SQLException']}"/> <p class="alert alert-danger"><b>Ops!</b> Erro: <br><br>…
-
1
votes0
answers30
viewsView Jframe image
When trying to display an image in JFrame, it is always displayed with height size, a few pixels less. How do I solve? public class Janela extends JFrame { private JPanel painel; private…
-
1
votes1
answer3600
viewsHow to pass data between Activities
I have a code that transforms getText in string and would like to pass this string to one other Activity in a simple way, but not an Activity that comes right after this. My code: @Override…
-
1
votes1
answer274
viewsJava - Add information in XML file with Jdom
In this code an xml file is created and an element is inserted: comentarios = new Element("comentarios"); myDocument = new Document(comentarios); comentario = new Element("comentario");…
-
1
votes1
answer1028
viewsFill object list with Sqlite data
I have a state object containing the following attributes. idState (String), siglaState (String) And I have a table already filled in the database with the same attributes above. But I would like to…
-
1
votes1
answer117
viewsJava database insertion problem
I’m trying to make an app of a veterinary clinic and followed all the steps right to create the database, connect with the eclipse and etc. The program connects, but does not insert anything that…
-
1
votes0
answers89
viewsCould not allocate dup blob fd
I have approximately 1,500 markers on a map that are being shown through clusters so as not to overload the application. these markers are currently shown as BitmapDescriptorFactory.defaultMarker()…
-
1
votes3
answers656
viewsHow to store values in a vector using inheritance/polymorphism?
I’m starting in the Java language and I ran into a problem. The following is as follows: I have 1 class that calls Vehicle, it has the attribute mark(string) and has 3 classes that inherit it, in…
javaasked 7 years, 4 months ago Gabriel Queiroz 47 -
1
votes0
answers304
viewsSplit Method - Split into 3 parts
I have an instruction to separate two words from a string and put into an array. This instruction is working very well. Below: public static List<String> converterCamelCase(String original) {…
javaasked 7 years, 4 months ago Meire Aparecida Santos 21 -
1
votes1
answer105
viewsHow to configure the Demoiselle 2.4.2 Junit component to inject EJB dependencies
I have a Demoiselle 2.4.2/JSF/Hibernate application that presents several test cases in full operation. The Bcs operated by these test cases undergo several dependency injections without any…
-
1
votes0
answers13468
viewsHow to represent a class diagram between Manager and employee
Hello, everyone I have a Food Truck system and need to know mainly the relationship of the manager and employee... Is my diagram correct? The module 1 mainly. • Specification: Manager module I.…
-
1
votes0
answers37
viewsProblems with Call Post
Following I am making the following mistake when calling a POST method 405 (Method Not Allowed) follows the method I’m trying to call @RequestMapping(value = "/upload", method = { RequestMethod.POST…
-
1
votes2
answers1054
viewsHow to hide the keyboard when clicking an Edittext?
I have following XML: <android.support.design.widget.TextInputLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginRight="15dp" android:layout_weight="6"…