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
votes0
answers139
viewsReturn Null even with registration in Sqlite database
I’m having a problem making this query where I’m looking for the product code and service code. If I make a select without WHERE I get results but doing this way my Product object always returns…
-
0
votes1
answer434
viewsDifficulty generating a JSON object in the correct order
I am trying to generate a JSON object by following this model: { "schemas": [ "urn:ietf:params:scim:schemas:extension:oracle:2.0:OIG:User", "urn:ietf:params:scim:schemas:core:2.0:User",…
-
0
votes2
answers460
viewsNo result when sending data from a JSP form
I’m trying to make a mini-login screen, get the form compare data and after that redirect to a page JSP. <html> <head> <meta http-equiv="Content-Type" content="text/html;…
-
0
votes1
answer734
views -
0
votes0
answers101
viewsHow to filter Column in Jtable with Calendar type data
I’m trying to filter dates using the Tablerowfilter, but it is not working properly even selecting in the filter the exact column and for example typing 24/11/2017 the filter after typing the first…
-
0
votes0
answers25
viewsWhat are the risks in using Singleton in java
Hello, What are the risks of error when using the Singleton practice in java? I am using the following: private Os mInstance = null; private int numeroOs, updateServer; Context context; public…
-
0
votes2
answers92
viewsJDBC code fails with exception
I’m trying to perform a database search through java. I am using this code, but this entering the exception: public ArrayList<Pessoas> pesquisar(String nome) { ArrayList<Pessoas> lista =…
-
0
votes0
answers63
viewsStreamcorruptedexception error, when there is de-achievement of an object
I’ve burned my neurons trying to fix it, if anyone can help ; It follows the code that the error occurs. I’m trying to open subclasses that have been serialized, however this error occurs I don’t…
-
0
votes1
answer388
viewsFill label automatically when Stage opens - Javafx
I need a label receive a text automatically as soon as the stage started without having to click a button. As different texts are saved in a database, I need them to be loaded in the label when the…
-
0
votes1
answer73
viewsRequest problem via ajax
I have a JSP page to login to my system, but when trying to make a request via ajax to authenticate me, the form does not seem to be being sent correctly, as the redirection is done to the login…
-
0
votes0
answers123
viewsTwo filters working in a JAVA report
Staff I’m doing a job for the college I got on the report part and I created the report as the image shows However I could only make the name field work in a second java class I created using the…
-
0
votes1
answer153
viewsCollecting Facebook Data with a Boot Share
Good afternoon! I am doing my TCC and need urgent help! Please! Next... I’m making my app that at the end of the application the user can share, if you want through a shareDialog of the face...…
-
0
votes0
answers51
viewsConvert Bufferedimage to BLOB - DERBY - NETBEANS JAVA
I created an object with several parameters and all data is entered inside the database except the last of type BufferedImage. I have already converted it to bytes (or at least think). It is a jpg.…
-
0
votes1
answer137
viewsRead Arraylist that is serialized
I create and instantiate objects of the student type (abstract class), and add them in the array. After that, the serialization of the same is done. How can I deserialize this array, and print…
-
0
votes2
answers200
viewsSpatial + Postgis + Geotools Hibernate - Persistence Failure
I have a problem to persist a geometric data in the database (Postgres) I gave a read on the forums and documentation and found nothing about it, someone can give me a help? Libs: pom.xml with…
-
0
votes1
answer353
views -
0
votes1
answer89
viewsUsing data from an array of one class in another
How can I use the array palavra_vetor in another class. public class Lista{ String palavras_leitura [] = new String[50]; String palavra_vetor[] = new String [4]; String palavra; public void…
-
0
votes0
answers171
viewsDynamico menu with Bootstrap
Good evening, how do I make a dynamic menu with bootstrap? i can do with link to redirect to a page, but I am making a system and your menu is dynamic how can I implement? jsp…
-
0
votes0
answers84
viewsProblem to convert with composite key into jsf, selectonemenu
I am making a selectOneMenu where the itemvalue will be a composite key. Which will be separated by a hyphen. However, when sending, the getasobject method is called several times, sending all items…
-
0
votes1
answer249
viewsDoesn’t Index work on Arrays?
I have the following code that holds an array of 7 values, each for each day of the week. then I have to create a function that sums these 7 values (successfully concluded), tells what is the…
-
0
votes1
answer708
viewsTreating null Pointer Exception
I’m getting, in my back end, a json object from the screen this way: { "pessoa": { "nome": "aa", "nomeSocial": "aa", "tipoPessoa": "F", "nomePai":"", "dataNascimento": "15/06/1983", "nomeMae": "a"…
-
0
votes2
answers873
viewsHow to count the spaces of a String in java
Here I followed the example of the code I was making: package manipulacaos; import java.util.Scanner; public class ManipulacaoS { public static void main(String[] args){ Scanner ler = new…
javaasked 6 years, 10 months ago Washington142 3 -
0
votes1
answer162
viewsObject comes pro bean with all blank JSF fields
I have a list of Predio objects that is being iterated in my xthml Then, for each iteration, I create a panel and in each panel I display the name of each of the predicates in the list and a button…
-
0
votes0
answers45
viewsShow a set of images in a new layout from a list
Hello, i have an Activity class, which shows a layout with a list of items, which when clicking on each item, would show a new layout (books2), with a viewFlipper, however, each item in the list…
-
0
votes0
answers642
viewsHow to fix in my code: Null Pointer Exception
my database has those responsible with values of "Supervisor" and "Manager". However, I do a search to get the Employees responsible and no return. See my getResponsaveis method in my class "Maid.":…
-
0
votes3
answers1096
viewsGetting a binary file and saving it again
I’m running a test with a simple code, but it’s going wrong. I simply want to get the contents of a binary file that is an image (jpg), and save it again under another name. My code is this: String…
-
0
votes1
answer121
viewsPositioning
I’m having a hard time adding Abels in different positions, relative to a field (JTextField). I’d like to put one label before the field, the left, and a second label under the JTextField. Example:…
-
0
votes1
answer153
viewsHashmap overrides values
I am trying to generate a hashmap (String, List Exercises) from a json: [ { "grupo":"Joelho", "nome":"joelho_1", "habilitar":"1" }, { "grupo":"Joelho", "nome":"joelho_2", "habilitar":"1" }, {…
-
0
votes1
answer136
viewsCheck if given a value there are two values in the vector that summed are equal to the reported value
I’m making a game in which the user has a menu with options and the option I’ve crossed is the following, I do the normal loop and compare the values but it falls right into the ELSE, where I’m…
javaasked 6 years, 10 months ago Guilherme Ramos 55 -
0
votes1
answer42
viewsForce the user to type enter
In an excerpt of my code, I need the user to enter to continue the program, however the part where you should receive this entry is ignored. public void buscar_Aluno(){ //metodo que busca um…
-
0
votes1
answer673
viewsDynamically define text to Jlabels according to text field validation
I tried to add one label for each required component of my screen that is empty (field 01 and field 02), so I created a list of labels with the corresponding amount of fields/components. However,…
-
0
votes1
answer257
viewsAssemble a product table as a java jsp showcase
I’m having a hard time presenting a showcase product list using Java and JSP. I can get the data, but I don’t know how to fill this table using the <c:forEach> My table would have this…
-
0
votes1
answer318
viewsHow to set up a common java project, host and run on a server
Whoa, good night guys, so with some questions about java systems running without server. Some friends and I are developing a java integration project (we receive information from a server/service,…
-
0
votes2
answers120
viewsCollecting data from an array
I’m having a workout for college but I’m lost in my logic and how to solve it. I have to collect the game results and set the score for each result. the winner takes 3 points, a draw guarantees 1…
-
0
votes1
answer182
viewsHow to receive data from a Rest API using Apache Camel
And how do I receive data from a server REST passing an authorisation of the type basic in the header? I’ve tried so many ways and it doesn’t work, and when I test Postman, works normally. I’ve…
-
0
votes1
answer514
viewsClose modal JSF
I need to do mine deleteConfirmationModal close. It only works by clicking on NAY. I need to make him perform the action of YES and close the modal. <p:commandLink title="#{label.REMOVE}"…
-
0
votes1
answer383
viewsConvert an Object to Arraylist<Visitor>
I have a method that returns values from firebase. When received, I create a new ArrayList<Visitante> and the saved in a Object. ArrayList<Visitante> visitantes = new…
-
0
votes1
answer100
viewsPOST requests with Android loading icon
I’m making an Android application that will make some requests to an API, I generalized these requests in a class (Requestapi), where, to use it, just create a map with the information I’ll send to…
-
0
votes1
answer1103
viewsHow to remove a specific item from a double-chained list?
Given class No, being: public class No<T> { T elemento; No<T> proximo; No<T> anterior; public No(T elemento, No<T> anterior, No<T> proximo) { this.elemento = elemento;…
-
0
votes0
answers154
viewsManytomany include other fields
Hello, I have a relationship ManyToManyamid envio and carro, and would like to understand how do I save in the same table, which is created through this relationship, the entity id Local. Entidade…
-
0
votes1
answer120
viewsWhile error in joption pane: loop
I’m having a serious problem with while in the following algorithm: You have a data set containing the height and gender (male, female) of 50 people. Make an algorithm that calculates and writes: 1…
-
0
votes0
answers85
viewsAndroid - Error when buildar App in mobile debug
I’m having a problem doing Debug and generating a signed Apk, when I open the application is generated an error, I’m not able to figure out the solution to this error, in the simulator of Android…
-
0
votes1
answer71
viewsOne method taking information from another method
Hello, I would like a help. I’m redoing the object-oriented java workbook from Hidden Object and there came a question that I would like a help. In the booklet you ask to create a simple system of a…
-
0
votes1
answer33
viewsFragment not being loaded inside Framelayout
I created a Navigationview with 3 items, when clicking on one of them, a specific fragment should be loaded inside the Framelayout, but this is not happening. I believe the error is in XML, because…
-
0
votes1
answer357
viewsjava.lang.Indexoutofboundsexception: Invalid index 2, size is 2
I’m having an error to save my package’s vigencias, I’m passing the array position. which may be wrong? int position = 0; for (Pacote pacote: pacoteList) { Vigencia vigencia = new Vigencia(); if…
-
0
votes1
answer942
viewsAndroid studio Activity does not open with click button
My problem is the following. my application has a welcome screen where the user ckick the "continue" button and goes to the next screen. The next one contains a menu with several buttons. my problem…
-
0
votes1
answer70
viewsError connecting SQL Server to Java in Resteasy API
I’m using the driver JDBC from microsoft 6.0 in a design of an API using Java (JRE 1.8) with resteasy using Eclipse Oxygen and Tomcat 7 (I tried with other versions and presented the same behavior).…
-
0
votes0
answers260
views"Expected an operand but found const" when trying to run a Javascript script using Scriptengine
I’m trying to execute a method javascript from a project java. The logic I used I picked up on the internet and the same is so: final String javascript =…
-
0
votes1
answer332
viewsHow do you find out if the list is full?
The method below is to include a book in a list. Returns 1 if the book already exists in the list, 0 if it does not exist in the list and can be inserted and 2 would be for full list. I’m trying to…
-
0
votes1
answer80
viewsCast from object type name(String)
I get a list that has several types of Htmlelements. I need a Namevaluepair list, with name and value of each object. So I have this function that gets the list: private List getValoresPost(List…