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
answer415
viewsHow I Upload Multiple Images Automatically to Firebase Storage - Android Studio
I am developing an app, this app the user can already choose multiple images, but I am not able to upload the images chosen automatically to Firebase Storage. The user can already authenticate.…
-
0
votes1
answer71
viewsHow to open Webview in the last URL accessed
I’m making a web app with just one nick login. Every time someone opens the app, they only enter the variable url where the page asks for the nickname, but I wanted it to save the last URL to access…
-
0
votes1
answer51
viewsJSON_EXTRACT in Mysql by JAVA does not work
Hello guys I have a field in mysql called itemvenda of type JSON with the following data: {"secao": {"codigo": "114", "descricao": "FRUTAS 1"}, "gondola": "1", "cestaBasica": false, "departamento":…
-
0
votes1
answer370
viewsI need to copy a value that is in "value". I am using Eclipse Java Selenium Library
This is the html: input name="nr_proposta" type="text" value="52367" data-mask="9?99999999" data-mask-placeholder=" " class="form-control apagar" id="nr_proposta" In java I’m doing so: WebElement…
-
0
votes2
answers702
viewsQuery with Collection in JPA Spring Data
Good afternoon, everyone, I have a question that might help other people. In my project I have a vehicle entity, this entity has a collection of another entity called Optional (Vehicle Optional), an…
-
0
votes1
answer51
viewsListview repeats the last record inserted in Sqlite across the list
I’m learning how to develop mobile for Android using Java and started studies to persist data. Everything was fine until I tried to fetch the Sqlite data and insert it in a listview: the whole list…
-
0
votes1
answer88
viewsNullpointerexception when inserting java data
Hi, I’ve researched several forums, youtube and google outside... I need a lot of help because I have little experience but I really want to learn, in many things I can do but when it’s for dates…
-
0
votes1
answer75
viewsHow to pass a parameter from one Annotation to another?
How can I replace the value of @ConditionalOnExpression by the value passed in the SecurityConfig? Current code: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @EnableWebSecurity…
-
0
votes0
answers20
viewsHow can Firebsae Realtime NOT load previous data after logging out of the account?
At the beginning of conversation, I am very new in android Java development, however I have a problem with firebase Altime in my application. I turned on . setPersistenceEnabled(true); for it to…
-
0
votes1
answer40
viewsHow to destroy a jobSchedule via Activity?
I’m studying the services in Android Background and managed to create a service in Background that already works well in the background even after restarting the android or close the App. The…
-
0
votes1
answer65
views@Restcontroller returns to same page but with different URL
I’m using @Restcontroller to manage different Forms/actions on the same page (with Thymeleaf), and it’s working properly, but when calling method (triggered via button on page) when returning to the…
-
0
votes1
answer26
viewstextView does not change text
I created a Fragment in Android Studio, and in this Fragment there is an imageView and a textView which I want to edit by code. but the two do not change... public class HomeFragment extends…
-
0
votes0
answers54
viewsWhy does it give this error when executing the code? java.lang.Arrayindexoutofboundsexception: 0
package PilhaEstatica; public class App { public static void main(String[] args) { int numero = Integer.parseInt(args[0]); Pilha p = new Pilha(); int…
-
0
votes1
answer67
viewsUse seters methods within a void function
I’m kind of new to java and I’m trying to create an application where I call server data and fill an object, but the object is not filled, whenever I call the object all attributes are null. The…
-
0
votes0
answers73
viewsJava Date Picking Up Wrong Time
Well, I’m having the following problem getting the system time. in a java process I’m working on I performed the tests at a certain time, and the method below returned 1 hour more SimpleDateFormat…
-
0
votes0
answers420
viewsPokeapi: faster creation of a pokêmon list
I’m looking to create a program that offers information about Pokémon, using the Pokeapi, to gain access to each creature’s data. I’m doing this program through the eclipse, with the help of Maven.…
-
0
votes1
answer87
viewsMethod to insert into the database is not pulling value [JAVA]
Good night! I’m trying to do a college job (JAVA), and I have to insert the client data into the database (Mysql), I have a Client class, a form, and the database class. Form calling method for…
-
0
votes1
answer97
viewsHow to remove the Header Columns border
I can’t seem to remove the white edge of the header of jTable public static JTable CMtable(String[] colunas, int width, int height) { TableColumn coluna; JTable tbl = new JTable();…
-
0
votes0
answers587
viewsHow to create an Annotation to validate data from a DTO in Java?
I have a class of a DTO object that I receive in my control through a request using REST. See an example of a request using the verb Post: @PostMapping public…
-
0
votes1
answer48
viewsListview prints only the first element of Arraylist
My application has a screen that lists all the elements registered in BD. The method I use to list the results returns a List (in the Diagnosticodatasource class), until then all right, the problem…
-
0
votes1
answer73
viewsJava: Error passing references in a Supertype using Convert Pattern to convert DTO/Entity
I’m doing a serialization process of a DTO class for Entity and vice versa. And for that, I use a design pattern called Convert Pattern. At first, I created a generic class that performs these…
-
0
votes1
answer239
viewssql result in spring boot
Good afternoon, I need help to make an endpoint in Spring Boot, in the database (Mysql), I have the following query: SELECT U.NOME, P.DESCRICAO FROM USUARIO_PERMISSAO UP JOIN USUARIO U ON…
-
0
votes1
answer38
viewsSelect 1:n and n:1 using JPQL
Good night, I am trying to select between 1:n and n:1 tables using jpql table categoira @NotNull @Column(nullable = false) @OneToMany(mappedBy = "categoria") private List<ProdutoCategoria>…
-
0
votes1
answer76
viewsError of references to upload Tompcat application by Eclipse
Good afternoon, you guys! Here’s the thing: I’m with a JSF application that if I build it from Maven (Maven install) and get the . War generated and der deploy on it by Tomcat, runs normally.…
-
0
votes0
answers39
viewsDowngrade java version - The package javax.xml.parsers is accessible from more than one module
I have a project in Java 12 that is working 100%. My goal is to make a downgrade from Java 12 to 11, but when I make this change I get an error on specific dependencies. This is the mistake I get:…
javaasked 5 years, 5 months ago Felipe Effting 65 -
0
votes1
answer47
viewsHow to receive 2 thread response and store in one method?
The problem is this: I have a server that receives 2 players (each in a thread) using TCP/IP. In the run of each thread they inform the move (stone, paper or scissors). I have a class "Play", which…
-
0
votes3
answers100
viewsError doing an INSERT in Postgresql database
When making an insertion in the Postgree bank I have as a response a very strange error: 2019-11-22 17:06:30.310 ERROR 15212 --- [nio-8080-exec-2] o.h.engine.jdbc.spi.SqlExceptionHelper : Nenhum…
-
0
votes1
answer162
viewsHow to take the Jinternalframe Side Options Button
Hello, I wish to remove this side option button from my Jinternalframe: After reading in some places, I saw that theoretically this employee command to remove the button:…
-
0
votes1
answer130
viewsHow to do a Query ignoring the side spaces of the Column content?
Good morning, everyone! Using the Query: @Repository public interface SessaoRepository extends AbstractRepository<Sessao, Long> { @Query(value = "SELECT p FROM Sessao p WHERE p.dc_secao…
-
0
votes1
answer54
viewsHow to add registration to the list without harming existing data
Good afternoon, everyone, I have a model called User that has a permission list, example: @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @NotNull private String nome;…
-
0
votes2
answers44
viewsHOW TO ADD UP THE VALUE OF A PRO CLIENT COLUMN
Good afternoon Gentlemen, In benefit of my studies I am developing a simple sales system and I am already in the part of the reports. My doubt is as follows: How to make a select adding up the…
-
0
votes1
answer42
viewsJava array changing itself
Trying to create a method to randomly swap 2 lines of a matrix [n][2], whenever I try to create this new matrix, it changes the previous one too, no matter what I do, that is, after I run these…
-
0
votes1
answer471
viewsError - java.util.Date cannot be cast to java.sql.Date when saving data
When trying to write the data to the database, the program points me to this Exception:java.lang.Classcastexception: java.util.Date cannot be cast to java.sql.Date. The first code slime is Servlet…
-
0
votes1
answer521
viewsPostgresql error with Spring boot - api
Personal opa I’m making a very simple application, to see how postgresql works. I’m making a Spring Api application. My class @Entity public class Product Implements Serializable { @Id…
-
0
votes1
answer64
viewsSorting algorithms - How to discover comparisons and drives
package faculdade; import java.util.Random; public class Ordenacao { public static long comparacao; public static long movimentacao; public static void main(String[] args) { int[] vetor = new…
javaasked 5 years, 5 months ago Breno Nogueira 11 -
0
votes0
answers57
viewsButtons do not appear in Windowbuilder and problems to stop adding button in an arrayList
I’m having a problem:I can’t figure out the phrase that’s on the given button the moment that "color" is going through it. I wanted to know the phrase on the button when it changes color. another…
-
0
votes1
answer58
viewsMy Java Object is not persisted with all its XML attributes
I’m using the JAXB API. I can persist right a java object in xml but only persist the attribute "Name" the rest of the attributes are not persisted. Here are my codes: This is the method that saves…
-
0
votes1
answer55
viewsSalesforce Query Returning Wrong Date
In Salesforce when I run the following query SELECT Data_de_Nascimento__c FROM Account WHERE id = '0013K00000ABC' he returns me 1999-05-29 In Java, after I set up the integration, I run this…
-
0
votes1
answer90
viewsReplace this for with a Lambda solution
I’m studying lambda and wanted to change this solution of for who owns a break. The solution today suits me, however I wanted to know if the way I am using is ideal or there is a better. Basically…
-
0
votes1
answer106
viewsRead numbers using dot as decimal separator
I’m doing an exercise in which I have to take the radius as input value and return the circle area as output. The code compiles normal without errors, but at the time it will print the value it…
javaasked 5 years, 4 months ago Cristiano M 33 -
0
votes1
answer86
views -
0
votes1
answer365
viewsError connecting Flyway in spring application
Configuration of the POM: Application properties: Error while running project: 2019-12-19 11:23:27.844 ERROR 22884 --- [ restartedMain] o.s.boot.Springapplication : Application startup failed…
-
0
votes1
answer207
viewsInfinite recursion in a bidirectional Manytomany model in Hibernate
I’m trying to create a bi-directional Manytomany relationship in Java, I can already insert into the database smoothly, but when I try to bring data from these tables I fall into an infinite…
-
0
votes0
answers29
viewsSqlite bank closed when query
Good afternoon, I’m making an android application, I’m having some problems with the bank. When it runs on the emulator it calls the seller’s Activity after saved, it calls login, login has a…
-
0
votes1
answer502
viewsCheck if Jsonobject has a certain key
this.token() is a String of the kind {"erro" : "Valor do erro"}. But also, in case of success it may be: {"token" : "Valor do token"} My goal with the code below is to find out if the first index of…
-
0
votes2
answers58
viewsContent is not being saved to the file using the Printwriter class
The file, in fact, is created, but without the content it should have. Method Program: String program() { return "import java.io.*;\n" + "import javax.swing.JOptionPane;\n" + "\n" + "public class…
javaasked 5 years, 4 months ago Taffarel Xavier 1,327 -
0
votes1
answer131
viewsHow to take the value of a variable that is pointing to a list
Hello, I need some help with this code. I think it’s relatively simple for those who already have more experience. I’m trying to get the value of a variable, but when debugging, I see the address…
-
0
votes1
answer57
viewsjComboBox does not update data that is already in a . txt
I have a text field to get people’s names and a button that saves these names in a text file, and I also have a jCombobox, but it only shows the data that is inside the txt if I click Save. I wanted…
javaasked 5 years, 4 months ago Manuela carneiro 31 -
0
votes1
answer205
viewsInstantiating class with dependency injection
I have a method that calls other methods that are not predefined, I am using this library org.reflections and the method java.lang.reflect.Method#invoke to perform another method generically, that…
-
0
votes1
answer1040
viewsError android.view.Inflateexception: Binary XML file line
note the error message! 2020-01-03 16:37:48.091 27513-27513/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.resource.listfragment, PID: 27513 java.lang.RuntimeException: Unable to start…