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
answer98
viewsError validating login
I have the following code: package br.edu.utfpr.exer07; /* 7) Implementar uma interface que contenha os métodos à ser usados: a. double soma(double valor1, double valor2, double valor3); b. String…
-
1
votes1
answer721
viewsHow to generate a matrix of 3 columns where for each column there are 3 different possibilities?
The problem is as follows: In a vector I have 3 sets (A, B and C). Each set can have up to 3 distinct values(0, 1 or 2). This way I need to generate all possible combinations for this case, with…
-
1
votes1
answer1100
viewsConsuming JSON webservice with the use of Asynctaks
Well, I’m trying to make an application that logs into a database, previously I was using the thread method to get, this working, but at the time of informing the error messages on the screen, or…
-
1
votes0
answers77
viewsSession-timeout works on-premises and gives cloud error
Running the application locally timeout works, but when I put the application in the cloud I get this error message The requested resource is not available after time runs out. What I am doing wrong…
-
1
votes1
answer288
viewsiText framework generating empty file (0 kb)
I have a project that was generating the Pdfs normally, generating the texts and images in the file, it was a beauty, however, a while later it left unexpectedly to generate the file in the correct…
-
1
votes2
answers5027
viewsProduct of Matrices
I am trying to create a method that returns the product of two matrices passed as parameter. The method is working only for square matrices and not for two 2x3 and 3x2 matrices, for example. If…
-
1
votes3
answers1124
viewshow to show data from a sharedPreferences in a Listactivity
I’m starting to work with Sharedpreferences on android, a simple and fast way to store static and primitive data. However, my problem is showing these values stored in a Listactivity. I’ve looked…
-
1
votes0
answers105
viewsProblem with List and Hashmap
I have a list as stated below: List<Map<String, String>> lista = new ArrayList<Map<String, String>>(); Map as declared below: Map<String, String> mapa = new…
-
1
votes1
answer107
viewsJava website software integration
My question is this: My team and I are developing a software that analyzes a table with specific data, but to generate this table we use a website where you enter information and this website…
-
1
votes2
answers294
viewsJava error inserting picture into spreadsheet. Apache Poi
I am trying to insert an image into a sheet using Apache POI , but I am getting the following error : 03-03 20:21:50.898: E/SELinux(28413): selinux_android_seapp_context_reload: Error reading…
-
1
votes1
answer183
viewsArray to solve hidden sentence puzzle
" You have two arrays letras = ["m", "D", " ", "e", " ", "G", "v", "e", "i", "e", " ", "r", "S", "G", "D", "u"]; caminho = [ 12, 7, 11, 9, 8, 4, 15, 0, 2, 13, 14, 5, 10, 1, 3, 6]; There’s a hidden…
-
1
votes1
answer808
viewsRandomization in Memory Game
How can I work on this code below so that instead of appearing numbers on buttons appear images? package memory; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension;…
javaasked 9 years, 6 months ago Carlos Ximendes 267 -
1
votes0
answers52
viewsSort UI GRID record from filter
Hello, This image showed only the data that have "S", however, in addition to displaying them, I need to sort this from the search filter, IE, in this case, the result would be something like:…
-
1
votes1
answer915
viewsProgressbar using Javafx
I have a method that reads multiple files and generates a report for each file read. How do I take the time of each service and show on ProgressBar? I have to use Thread or Task? I tried to do it…
-
1
votes1
answer47
viewsMy Thread only runs 2 times
I have a method that takes several files from a directory lists them in a table and generates a report for each file. I put a thread in this method and now it only picks up 2 files and stops. Where…
-
1
votes1
answer1097
viewsRefresh Jframe
I made software to monitor servers I have a Jframe with several buttons in which these set a color (green if server is online and red otherwise). I do this test using ping. When I click the button…
-
1
votes1
answer45
viewsJSON does not complete when sending by Bundle
I’m trying to get the return of a push on android through the Bundle, but I’m having some problem performing bundle.getString("Message"); as it does not take all my reply which is in JSON format,…
-
1
votes0
answers255
viewsIn javafx how do I capture the column title click event to organize the records?
I have a tableView and this one has five columns. The first two columns are written with records I took from the database and the other three are just buttons I insert at the time of table creation.…
-
1
votes1
answer1815
viewsError using Javamail with Office365 account
I have a Java class that works perfectly to send emails through a Gmail account. However, even using the recommended settings to send an email via SMTP with Office365, an error is returned. The…
-
1
votes2
answers2173
viewsImport class that is not inside an eclipse project
I wonder if there is a way to import and instantiate an object of a class that is, for example, inside a folder in my files and not in a project inside the eclipse.
-
1
votes0
answers56
viewsIntegration with facebook login
I am developing an application and need to login with Facebook I did some research and I saw that you can do with the Client OAuth 2.0. But when I send the url request to return a token I take the…
-
1
votes1
answer38
viewsMethod to create a new list based on elements from an existing list?
In c# there is the function numeros.GetRange(0, quant); I would like to know the equivalent function of numeros.GetRange(0, quant); of C# in Java
-
1
votes1
answer775
viewsProblems with Nullpointerexception in a JSF project
I am with an application that is displaying the following error message; jun 01, 2015 4:15:05 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute ADVERTÊNCIA: #{pesquisaPedidosBean.pesquisar}:…
-
1
votes1
answer1100
viewshow to convert a request. String parameter to integer
In a program I have to do I arose this difficulty Familia.setSalariodoPai(request.getParameter("salariodoPai")); but this request is returning a String and I would need Integer .Bs that stretch is…
-
1
votes3
answers1748
viewsTest a constructor with more than one parameter
I am trying to create a test class for my constructor, but it receives three parameters and these parameters are validated within the class itself, to allow or not the creation of its instance.…
-
1
votes2
answers590
viewsHow does creating an Array work?
When using the command new() for the creation of any object we call the constructor of the class of that object and obtain the reference to the instance created. However, what happens when creating…
-
1
votes2
answers236
viewsError bringing Time and Date
I am registering in the Mysql database values such as time and date. Code JAVA: public String getDataPedido() { StringBuilder horaSistema = new StringBuilder(); GregorianCalendar pegarHora = new…
-
1
votes2
answers201
viewsJSF Converter Generating Exception
Not to escape the scope of the previous question: Product displayed is the smallest within the group (Criteria) The problem apparently of the issue has been solved, although it was not possible to…
-
1
votes1
answer225
viewsJava check two tables inside Sqlite
I have a database that has two tables, being them EstoqueDBQ and FilaDBQ, I need to create the following logic. If the value exists in the table Filadbq and in the EstoqueDBQ, this value should be…
-
1
votes1
answer1884
viewsHow to update a Jlabel periodically?
I would like to know how to keep updating periodically a Jlabel, since this label depends on another method. In this case it would be the lblNewLabel_1. public class MenuGFinancas extends JFrame {…
-
1
votes1
answer552
viewsContainer and swing design
What are the precise definitions of Container and Component in Swing? Why are these elements important for building the GUI?
-
1
votes1
answer2564
viewsIs it possible to modify any game?
It will be possible to modify an action or add some new object in any game using java? For example: add a new monster to the game, add properties, increase player speed, life etc.
-
1
votes1
answer1165
viewsHow to make a simple image gallery for Android?
I need to create an image gallery where I swipe to move to the next image. I’ve been doing some research and I’ve found a lot of ways to do something similar to what I want, but I got very confused.…
-
1
votes1
answer6426
viewsPutting an image as background on primefaces
how do I put a background image in primefaces. I’ve tried some shapes but none worked out. The closest to a good result I arrived was using <p:graphicImage/> but when I minimize a menu or do a…
-
1
votes0
answers29
viewsProblems with Autocompletetextview
I’m wearing it for the first time Autocompletetextview with Json back through the google the streets. Everything goes well until the moment I click on the street and get let’s imagine that I click…
-
1
votes2
answers1151
viewsJava Desktop Application Root Directory
I have a java desktop application, being an executable jar and need to know the root directory where the jar is running. I’ve searched several ways and I haven’t found what I need, I’m always seeing…
javaasked 8 years, 8 months ago Jeremias Santos 403 -
1
votes2
answers1341
viewsJava coupon printing
How I do coupon printing in java, both in dot matrix printer, and both in tax-free thermal printer? And covering all manufacturers... has as? Programming changes depending on the manufacturer?…
javaasked 8 years, 8 months ago Rodrigo Lima 315 -
1
votes2
answers2837
viewsHow to clear a vector?
I have a Java vector of size 5 to allocate 5 first numbers. I have to empty it when it is full in order to allocate 5 more numbers. And keep this routine until all the numbers are read! int x[] =…
javaasked 8 years, 8 months ago alexjosesilva 3,119 -
1
votes1
answer764
viewsHow do I initialize the centralized Jframe?
I’ve tried the this.setLocationRelativeTo(null); only he wasn’t in the middle of the screen, I’d say he was much more right and down than in the center. public Principal() {…
-
1
votes1
answer86
viewsInclude BD data in Java
I’m following a distance course, only I’m having trouble including the record. It does not include, but it also does not present any error, and by the examples of the teacher I followed, it did not…
javaasked 9 years, 5 months ago Itallo Freire 215 -
1
votes1
answer799
viewsHow to create JPA class from an N to N relationship
Good afternoon Guys, in my work of java Web I have two tables where the relationship is Manytomany, so I went to the database, created a third table with the key of the other two, but when it comes…
javaasked 8 years, 8 months ago Higor Senna 366 -
1
votes1
answer87
viewsHow to add a Progressbar to a Pageradapter?
I have a Viewpager that uses a Pageradapter to make an image slide. In my class extending Pageradapter I have an Asynctask that loads images from the internet and plays in Imageview. How can I put a…
-
1
votes0
answers119
viewsBean Validation of dependent fields
I’m starting with bean validation and I need to validate dependent fields. Example : I have the fields dataInicio and dataFim The field dataFim cannot be smaller than the starting date. I know I can…
-
1
votes0
answers165
viewsJboss Error 09:51:36,559 INFO** [Server] Jboss (MX Microkernel)
I am trying to run application using Jboss 4.2, but when I try to start it, I have the following information on the console and do not leave it. 10:42:39,847 INFO [Server] Starting JBoss (MX…
-
1
votes1
answer531
viewsDatatable does not update immediately after "action"
I have a DataTable with some data when I select a table row and click on finish process that row is saved in my database with the status Finalizado and the Cargo user logged in but this row only…
-
1
votes1
answer125
viewsERROR starting the java project with Tomcat
I put the project War in the webapp folder but the application does not appear in the browser gives this error: SEVERE: Error deploying web application archive webrun.war…
-
1
votes2
answers303
viewsAndroid app => Unfortunately project has stopped
I’m studying Android and want to make a simple parameter pass to another Activity but the application is finished in the emulator and logCat shows a Nullpointerexception, someone can help me? Class:…
-
1
votes1
answer65
viewsRemove pagination from Demoiselle
I’m using Demoiselle and its pagination feature, but when I need to use all the listed objects, ie, use the full return, it does not let, it keeps the pagination. My pagination: @Override public…
-
1
votes1
answer70
viewsHow to compare these 2 arrays inside this while?
I am developing a game similar to Hangman, where the user has to hit the word chosen by the computer in up to 8 attempts. The variable mascara is an array of characters that corresponds to the word…
javaasked 9 years, 5 months ago Lucas Goeten 11 -
1
votes1
answer1440
viewsHow to center a Jframe on the computer screen?
I’m using the GUI Builder Netbeans to do some things with Swing and would like to centralize the JFrame, in which is my application, on the computer screen. However, do not know where I edit this…