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
answer1598
viewsCan anyone explain what a Spring Framework bean is?
Can anyone simplify what a bean is ? I’ve read the description by the Spring site itself but it didn’t make much sense (to me) what it actually is, and what it actually serves. I know I have to…
-
0
votes1
answer27
viewsChange shadow color of Viewpager
How do I make this shadow of viewpager change color?…
-
0
votes1
answer478
viewsOpen HTML via Asset
How do I open html via Asset? I’m making my text editor application, I really need to learn how to open html via Asset.
-
0
votes1
answer111
viewsWhat was the error in the last UPDATE use line in Mysql?
I developed a final project without error, done in Java, but still have only one error UPDATE in the last row of table creation clientes database in Mysql language. I am asking to update the…
-
0
votes1
answer550
viewsJasper Reports - Create Vertical Line in Detail
I have a bit of a problem, I use xpath to generate data from an xml for the report and when I put the information in Detail, they appear normally, but the vertical line does not stay until the end.…
-
0
votes0
answers167
viewsProject error: java.sql.Sqlexception: Cannot create JDBC driver of class '' for connect URL 'null' - Javaparaweb
I’m studying Java by the book "Java for Web 2º Ed.", I was going quiet, but I stopped in the following error: abr 12, 2018 11:39:31 PM org.apache.tomcat.util.digester.SetPropertiesRule begin…
-
0
votes0
answers126
viewsNullpointer in Jasper report
I have a report done in Jasperreports that works normally in a local bank , but if I call the same report with the same database only that online it does not work anymore, simply appears the error…
-
0
votes1
answer103
viewsProblems adding Jsonobject to Jsonarray
import javax.json.Json; import javax.json.JsonArray; import javax.json.JsonObject; import javax.json.JsonValue; // código JsonObject object = Json.createObjectBuilder().build(); JsonArray array =…
-
0
votes1
answer261
views(Solved) Error running Android app on mobile but working on other devices and emulator
[Solution]: The solution found was to add the attributes android:hardwareAccelerated="false" , android:largeHeap="true" in the manifest I’ve been dealing with Android for a while and I got this…
-
0
votes1
answer86
viewsHow does Spring MVC identify Model, View and Controller files?
I wanted to know how Spring tracks these files. So far I know that Spring MVC has the DispatcherServlet that is responsible for sending the requests to the controllers that respond to such URL. But…
-
0
votes1
answer875
viewsWebview Javascript calling java method - android
I have a webview app that calls an index.html : WebView webView = (WebView)findViewById(R.id.webView); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient(new…
-
0
votes1
answer628
viewsError in pom.xml
I am working on a project, I used the eclipse IDE java tool and I configured my project to Maven project, and in this I configured my pom.xml to run Hibernate + jpa and this occurred me the…
-
0
votes2
answers108
viewsAutomatic user address search
Any automatic search method for the address from the current location of the user? No need to fill in the address fields. Informing the zip code or clicking a search button.
-
0
votes1
answer488
viewsCheckbox and Radiobutton Validation
How to validate and return a message if Checkbox and Radiobutton components are not selected in an application ? JAVA
-
0
votes1
answer170
viewssubclass does not incorporate super class method
This is the first time I’ve had this mistake. I have the Class Loja that extends into several subclasses. problem is that subclasses do not "ask" the super method Shop: public abstract class Loja {…
-
0
votes0
answers205
viewsHow to run database call with JPA parameter
How do I call a stored procedure from the bank I have the following procedure stored in the database, and I wish to execute your call by passing the parameter projId, using JPA to pick up the…
-
0
votes2
answers87
viewsReturn message if no checkbox is selected
How to do the treatment in this code so that it returns message to the user select at least one checkbox if it does not select any? public void verificaCheckBox(){ Listcheck.clear(); if…
-
0
votes2
answers302
viewsApplication with JBOSS Wildfly reply via DNS
I am extremely beginner in this part of setting environment and need to put an application I developed in production. I already have a registered domain and I would like the user, instead of typing…
-
0
votes1
answer269
viewsError 500 in java webservices when testing in Postman
I am a good time trying to solve this problem,I configured my environment about 3 times but when it comes to testing Postman always gives the error 500,I believe that my problem is not in the entity…
-
0
votes1
answer124
viewsHow to add Jspinners values?
I want to make a simple program where the user puts a number on a JSpinner and, at the click of a button, will appear in another JSpinner, the value of the first summed by 2. However, I cannot sum…
-
0
votes1
answer76
viewscommandLink does not link to the screen
I’m starting with sf and I’m having a problem with this project. The following command does not create the link on the screen I need to go to the next page, just gives me "New user" written on the…
-
0
votes0
answers35
viewsProblem with Java
When I try to open a BAT file, with the following code: @ECHO OFF SET PASTA_BASE=%~dp0 START CMD /C %PASTA_BASE%\client.js -a DESE -p Terminal -x The following error message appears: "Could not…
-
0
votes0
answers29
viewsIn java web development, what is the best practice for image storage? In a database or image folders?
In a Java web application, what better way to store images? Store in databases or image folders and in the database use paths to these images? And how would you do that? Thinking of using write in…
-
0
votes3
answers3113
viewsConsuming HTTPS web service
I’m trying to consume the zip code webservice https://viacep.com.br/ws/88701001/json/ I’m using Java Web - JSF with Wildffly10 For this I am using the following code. String URL_WEBSERVICECEP =…
-
0
votes0
answers15
viewsHow can I control the time a data was entered in the database - sqlLite Android
I need to control the time a data is entered into the database, to do certain actions as a function of time. I thought to make the difference between the current system time and the insertion time,…
-
0
votes1
answer264
viewsHow to update text in jTextArea?
How do I update the jTextArea? I try to update it with the click of a button, but I can’t. I want to add new texts along with the previous ones, but so far without success. I performed the…
-
0
votes1
answer1081
viewsConnection portal serial scale using JSSC
I communicate with a scale via serial port, and today I use the library JSSC however the returns of the hour balance are of weight and time are of different characters, researching I have come to…
-
0
votes1
answer425
viewsJava help with the concept of how to relate classes
package br.edu.utfpr.exer05; public class Porta { boolean aberta; String cor; double dimensaoX, dimensaoY, dimensaoZ; void abre() { this.aberta = true; } void fecha() { this.aberta = false; } void…
-
0
votes1
answer18
viewsProguard, how not to change a certain variable
I have a variable in my Java code, and I want to obfuscate the code using Proguard, but there is a variable that I want to keep the name, after obfuscation, because I will use this application in…
-
0
votes1
answer55
viewsFailure to build Spring MVC application when configuring AOP bean
I’m trying to configure AOP in the spring.xml of my Spring MVC application, but I can’t build. I consulted the documentation, but following it did not succeed. The code is as follows:: <beans…
-
0
votes1
answer382
viewsTake a class that has a certain interface implemented in Generics
Hello. I want to do something like metodo(Class<? extends ClasseAbstrata> classe), only that of an abstract class, I want to use a interface, but I’ve moved on from extends for implements the…
-
0
votes3
answers3989
viewsHow to Generate random numbers without repeating in Random?
So far I have been able to generate random numbers and store, but I have no idea how not to generate repetition. So far it’s been like this: package curso1; import java.util.Random; public class…
-
0
votes0
answers66
viewsAccess modifiers
It is wrong to claim that access modifiers control the attributes and methods of a class, avoiding inconsistency in values and objects ?
-
0
votes2
answers691
viewsHow to exchange the lowest value of a vector with the highest value?
For now I can only find the smallest and largest, but I can’t change positions. for(int i=0; i < vetor.length; i++){ temp = vetor[i]; if(maior < temp){ maior = vetor[i]; vetor[i] = menor;…
-
0
votes0
answers116
viewsHaving Stream<Stream> how can we get the Stream that contains more elements in the other Stream
I have 3 interfaces public interface IGhOrg { int getId(); String getLogin(); String getName(); String getLocation(); Stream<IGhRepo> getRepos(); } public interface IGhRepo { int getId(); int…
-
0
votes1
answer289
viewsPostgresql reserved word problems
Dear friends, I am using locally a code downloaded from Github for educational purposes and I am having trouble deploying War, the error has to do with a reserved word from the database used in the…
-
0
votes1
answer271
viewsCardview inside a scrollview
I’m not getting the scrollview to work on my cardview.... Since scrollview works with a single child, I changed the main layout to Scrollview and created a linearLayout to encompass the rest within…
-
0
votes0
answers114
viewsIs it possible to create more than one java9(module-info) module per mavem project in the eclipse?
I am testing the java 9 module system and so far I have been able to create a project in eclipse (Maven or java) and create the module-info by the option : Right-click on the project + configure +…
-
0
votes1
answer700
viewsRefresh in jframe automatically
I will start a project where I will do the control of queues in java, normal queues even, as if you arrive at the bank and see on the screen your name. I’ll give a summary of the project to be…
-
0
votes1
answer32
viewsInsert Image in code, Android Setimage, Error while doing dynamic in java
ImageView img = (ImageView) findViewById(R.id.img); //Atualizando a imagem dinamicamente. A classe R é utilizada para acessar o recurso. img.setImageResource(R.drawable.img); There’s a mistake, I…
-
0
votes1
answer61
viewsApache Tomcat mirroring - Work
Explanation : Currently when we update our client’s project it is "off the air" during this update, the idea is to be able to update the project without having to stop the client, I saw something…
-
0
votes1
answer372
viewsFor loop in Java
need to receive an n number and then repeat the receipt and processing of the v string, n times. I tried to do the following: import java.util.Scanner; public class Main { public static void…
-
0
votes1
answer24
viewsWhere on the list with recyclerview
I need to get the position of an item in the list, where the code is what I passed. In C# I do this like Python, how to do in java? public void onBindViewHolder(final LineHolder_Entidade holder,…
-
0
votes1
answer1148
viewsHow to set the key and value of an object creating an instance and put the values in the map?
I only know how to hashmap in a way that is creating an instance in the put method to insert values. Follow the way I do: import java.util.Map; public class Teste { public static void main(String[]…
-
0
votes1
answer161
viewsCode Error for Popular Jlist with File Names of a Folder
I cannot pass a method to get the name of the files in a folder. I have the code below: inicializar.addWindowListener(new WindowListener(){ @Override public void windowOpened(WindowEvent arg0){…
-
0
votes1
answer45
viewsAndroid - Add a double every time the function is called
How do I make a function always add a double value to another, since onClick() adds only once. Mainactivity.java: Button somar = (Button)findViewById(R.id.btn); TextView txt =…
-
0
votes0
answers28
viewsCreate pdf files with pdBox
Good afternoon, I am trying to create a PDF file with pdBox, recording in it what he finds in the matcher of my application, but the created pdf comes out blank someone could help me in this doubt?…
-
0
votes1
answer46
viewsHow do I print on the screen the equal values of two integer vectors?
I did it using two ties for, but the teacher did not accept. I need to do the comparison using only a while loop. EX. vetorA = {1,2,3,4,5,6,7,8} , vetorB = {3,4,7,8,9,10} So it works, but it needs…
-
0
votes0
answers41
viewsI need to reverse a vector
I need to know how to change this logic to receive vectors of any size. public void inverter(int[] vetor) { int i; int temp; for(i=0; i < 3; i++){ temp = vetor[i]; vetor[i] = vetor[8-i];…
-
0
votes1
answer89
viewsClick on the screen and change the values of the variables
I need to implement in the code functionalities so that when I click on the screen, changes the values of some variables that are in the code. However, when I click it stays the same. My main class:…