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
answer173
viewsDoes System Modeling Need Java?
I used structured data diagrams more than 15 years ago. In 2002 I did not use POO. I want to relearn modeling systems using POO. Do they indicate any material? I need to learn Java or just POO in…
-
0
votes1
answer126
viewsImage does not appear in the project
good morning, I am trying to put a pdf icon on my project, but it does not appear. I am using f:Facet this way. <h:commandLink> <p:graphicImage name="/resources/img/pdf.png"/>…
-
0
votes1
answer1056
viewsHow do you resize a Jpanel inside a Jscrollpane automatically?
After adding a greater amount of buttons than the JPanel support, I would like to update(increase the JPanel) automatically, how can I do this? private JPanel contentPane; private static int tamanho…
-
0
votes1
answer69
viewsText changes on the label with switch
You know that initial Pokemon conversation? "Welcome to the world Pokemon" - ENTER "Are you a girl or a boy?" -Enter CONTINUES.... So, I’m trying to do a Java swing, at the moment it’s like this:…
-
0
votes1
answer312
viewsJava waiting for the end of a . bat
I have the following scenario: I have a Java application with Swing; Where through a jTextField, I get a piece of information; With this information, I create a . bat This . bat calls a file . exe…
javaasked 6 years, 7 months ago Guilherme Bigois 348 -
0
votes1
answer76
viewsHelp with level system (RPG)
Hello, I am trying to build a leveling system (like an RPG). So far I have it: Math.floor(1000 * Math.pow(level, 1.5F)); Here I enter with the level, and get the XP necessary to reach it. But now I…
-
0
votes1
answer372
viewsHow to start editing a Jframe by hand and continue the final adjustments by the Netbeans "dashboard"?
I was able to write the code or generate a new javaswing file + JFrame, but would like to do writing the code and continue editing with the "dashboard" without adding a "new file.…
-
0
votes1
answer30
viewsHow to render name or social reason according to type
I am trying to render the contents of a column of a table with name or Social reason depending on the type <f:facet name="header"> #{contato.tipoCadastro.codigo eq '1' ? 'Nome' : 'Razão…
-
0
votes1
answer817
viewsjava.nio.file.Accessdeniedexception error while doing video thumbnail
I’m trying to create a thumbnail of a video using Jcodec.jar. On my "localhost" machine, it works perfectly, but when trying to do the same process on the server. Obs: I am using a Debian server it…
javaasked 8 years, 4 months ago allan braga 3 -
0
votes1
answer104
viewsMerge XLS (JAVA) files
I have several files . xls with 1 sheet each, I would like to merge all sheets into a single file with several sheets.
javaasked 6 years, 7 months ago Rodrigo de Bastos 11 -
0
votes1
answer211
viewspublishProgress() updates onProgressUpdate() only at the end of theInBackground()
I have an app that updates the progress bar, the same way I’m doing in another app, but in this new app, the onProgressUpdate() only executes at the end of doInBackground(). It is called the method…
-
0
votes1
answer140
viewsHow to print only one sale with your products using jasperReport?
I am trying to print only the sale you want with reports Jaspersoft, only that is printing all sales and all products that then added on other sales. Image of the report java imprint. String…
-
0
votes3
answers1664
viewsString Format CPF on Android
I have a CPF variable that is populated with a value that comes from the database (11122233344). Before giving setText(), I need it to be formatted in 111.222.333-44. How could I do this?…
-
0
votes1
answer487
viewsAndroid - Asynctask and Progressdialog
Hey there, guys. I’m just starting in the Mobile area and I’m having some problems with the issue of user experience in my App. In my App, it obtains a JSON from the server through a AsyncTask.…
-
0
votes3
answers320
viewsWhere to put the files?
When we use Spring and Maven, where should we put the files? in the webapp folder or in the Webcontent folder?
-
0
votes0
answers38
viewsHow to upload an image to a file using JSP
Hello how are you? I apologize for the language, because I live in Uruguay. I wanted to know how and which Java objects (specifically JSP) I can use to upload images to a file on my Windows? I have…
-
0
votes1
answer101
viewsHow to display data in java Arraylist
How I list the information stored in an Arraylist in java? Follow the code for analysis. public class Main { public static void main(String[] args) { Aluno aluno = new Aluno();…
-
0
votes1
answer38
viewsIt is possible to request a specific file for the user
I want to get a special file from the user. It has how to put the name of this file as type in Intent? For an image for example, use: Intent intent = new Intent(Intent.ACTION_PICK)…
-
0
votes1
answer1601
viewsCSS and JS are not being applied to the project in Spring MVC (config via java)
I’m a beginner with Springmvc and I’m learning through the book Spring MVC (Master the main java web framework, by Alberto Souza, code house). Before starting with Spring, I created a Maven project…
-
0
votes1
answer172
viewsHow to Identify Carcter
I have a class who catches a String and look at the first character and if the character is empty (" ") it returns me the first letter. public String textReturn(String x){ int v1 = 0,v2 = 1; String…
-
0
votes1
answer63
viewsKeeping the context of a List out of Thread
I wanted to upload the list to Thread and then have access to it after the action is over. You have this code but at the end of the thread the list is null; someone would have a tip to help me?…
-
0
votes0
answers78
viewsWould it be possible to send pre-programmed messages via messaging apps?
I am making an application in Androidstudio/Java that needs to send messages constantly, consists of a trade quality evaluation program, which when evaluated as bad will be sent an sms to a specific…
-
0
votes2
answers189
viewsProblem to add content in Arraylist
I have an abstract animal class, which feline and canine inherit from it, and I have a client class that owns 2 arrays, one to add felines and one for canines. However, when adding the feline in the…
-
0
votes1
answer203
viewsWhy don’t you put it in the database?
Why does the following database entry code not work? The code reaches Joption "arrived!" private void btnCadastroActionPerformed(java.awt.event.ActionEvent evt) { String sql = "INSERT INTO…
-
0
votes1
answer424
viewsUsing executor on android
I’m trying to use an executor to record data in the database using threads. When instantiating an object from the Executor Service class and retrieving an instance from…
-
0
votes1
answer532
viewsAndroid - How to finish/finish an Activity?
How to close, finish, finish a Activity, after executing a method? In my project, I have two Activitys: Mainactivity (Home, Home screen) Editoractivity (Performs some simple tasks) I would like to…
-
0
votes1
answer546
viewsEdit datatable record
Next person: On my datatable when I click the edit button, you are not opening the screen for editing. Can anyone help me where I am missing? page: <h:form id="pesquisa"> <p:panel…
-
0
votes1
answer1848
viewsWhat’s the best way to present only two houses in a java float
I am creating a simple application in android studio, where I make a division and present its result in an Edittext, however I would like to present only two decimal places, which is the best way to…
-
0
votes2
answers34
viewsBecause '08' generates error inside the Eclipe?
I have a class with 'int = dia, mes e ano' and on the other I’m calling them. Only that caught my attention was that when I put the value '08' says 'The literal 08 of type int is out of range'. but…
javaasked 6 years, 7 months ago Maurício Maciel 27 -
0
votes1
answer172
viewsSettings Instance Tomcat / Nginx java sprintg
I need to configure a new instance of Tomcat to host a new application and in parallel configure Nginx to do the reverse proxy. The application is developed in java Spring. The application is two…
-
0
votes2
answers47
viewsMapmaneto Person x Document Onetoone, Cascade
I created a Person class and a Document, the Document data I can make the persistence but when doing Onetoone in the Person class and insert a new table in the Person class appears an error that the…
-
0
votes1
answer241
viewsError running JSF project by eclipse
Good evening , I’m trying to run a project in the eclipse, but Tomcat is throwing me the following exception. Does anyone know what can be? fev 25, 2018 8:57:57 PM…
-
0
votes0
answers147
viewsReturn method
reciso create a method that returns the variable HUMIDITY; However I need to make a Thread to update the value of humidity every little time. (Moisture is read through the Arduino). You need to…
-
0
votes0
answers62
viewsProblem starting Tomcat server 8
Feb 25, 2018 9:39:49 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to…
-
0
votes0
answers285
viewserror: cannot find Symbol variable Toolbar and section_format
I’m learning to code for Android and created an app from scratch on an empty screen. Then, I decided to put my Activity in a model with tabs, where the first tab would be this screen I already made…
-
0
votes1
answer214
viewsJava Restful API gets wrong date from POST JSON
I have a java Rest API that is getting the wrong date. Javascript sends the following JSON: { "pessdtcad": "2018-02-24", "dataNascimento": "1984-05-18", "nome": "GUSTAVO DE FREITAS", "sexo": "M", }…
-
0
votes1
answer235
viewsError in properties file configuration
I am trying to set up a properties file. I followed some tutorials but unsuccessfully. I am with the following error: Caused by: java.util.Missingresourceexception: Can’t find Bundle for base name…
-
0
votes2
answers6574
viewsTo enable and disable a text type input after a value selected in the combobox
My jQuery < script > $(document).ready(function() { var tipo = $("#idTipoParticipante option:selected").text(); if (tipo == 'Personagem') { $("#enable").click(function() { // habilitando o…
-
0
votes1
answer66
viewsError to play search screen data for registration screen for editing
Gentlemen, I’m having a hard time getting the objs from my customer search screen, and playing it on the sign-up screen for editing it. My search screen is with a button with a <p:button…
-
0
votes1
answer127
viewsHow to fix a Bug with loading a Fragment within another Fragment?
I have a Mainactivity with Navigation Drawer, and all the items in this browser opens in Fragments. When starting the application I load the home page as follows:…
-
0
votes2
answers273
viewscomparing a variable with a vector or list
Usually to perform a conditional using an array or a list and need to perform a for and perform the if line by line in this way. //sendo item uma string e listaItens um List<String> for(String…
-
0
votes1
answer65
viewsCreation of Formulars
My problem is this: I have a class for example client she via own name, surname and Cpf and a list of objects of the address class. The address class will only have the field patio and city. My…
-
0
votes2
answers90
viewsError trying to scan an array
I am trying to scan the array within the loop, as per the code below: import java.util.Scanner; public class RapidoPora { public static void main(String[] args) { int[] nota = new int[10]; for(int c…
-
0
votes1
answer137
viewsI can’t find my GET method path in Webservice Rest
@Path("webservice") public class WebService { private CriancaDAO criancaDAO = new CriancaDAO(); @GET @Path("getCriancaTodasCriancas/{idCrianca}") @Produces(MediaType.APPLICATION_JSON) public…
-
0
votes0
answers216
viewsCompare text file with database data
Good morning, I would like to know how to compare several txt files with Mysql, so when I create a txt file in the folder it does not re-enter the data of the other txt files in Mysql. I am using…
-
0
votes0
answers213
viewsPrimefaces p:selectBooleanButton ignoring Converter
I’m trying to get a p:selectBooleanButton is used to select the status of a registration form. The value of the attribute in the template is a Enum with two values that can be translated as True or…
-
0
votes1
answer207
viewsStatic modifier in an attribute
I’m wondering if the Static modifier necessarily needs to be in the same package as the other classes in my project. Example: I have a class called user within the user package and another class…
-
0
votes1
answer45
viewsArrayindexoutofboundsexception when trying to fill a Jtable from a query
I am performing a query in the database to pass the information to a JTable. However, when performing a query, the following error appears: Exception in thread "AWT-EventQueue-0"…
-
0
votes0
answers179
viewsSpring Web MVC - Controller not working
I’m trying to make a basic application, with a controller that sends a message to the screen and puts CSS into the project, but either CSS works or the controller. Follow the codes: 1) Netbeans…
-
0
votes1
answer108
viewsError while trying to change column widths from Tableview
I have a method that increases and decreases the width of my table at the click of a button (it works perfectly): public void toggleTela() { if(this.tblAudiencias.getWidth() == 940) {…