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
answers48
viewspercentageCommomWords JAVA In String CHATBOT
I would like a help to implement the method percentageCommomWords in my code, because it meets with contains and this ends up complicating a little at bot time to answer the right question. Follow…
-
0
votes1
answer111
viewsRetrieve the context of a Class (Model)
I have a model and I want to use the "Sharedpreferences" inside it. To instantiate the SharedPreferences, i need context(context), as I do to recover that context? public class PostagemCurtida {…
-
0
votes2
answers27
viewsGet an item from each Row
How can I get an Item from each Row? For example, I have a column with the following rows: TEST TEST TESTE2 TESTE2 TESTE3 As I wished: TEST TESTE2 TESTE3 My code: public void carregar(){ qy =…
-
0
votes1
answer21
viewsDWR Framework - Does not run
I am trying to use the DWR framework to populate a select from the output of another select in my JSP. Only you have no action after selecting the first select. JSP 1º SELECT: <select…
-
0
votes1
answer183
viewsSpring MVC - Multiple Builders
I’m having a problem where a Framework I’m using needs a default constructor, this one calling my Service class: @Service public class FuncionarioService { private FuncionarioDAO dao; public…
-
0
votes1
answer148
viewsInsert FXML into Scroll Pane and pass data to controller
My system consists of a main screen, which has a scroll-pane that I’m populating with a list of other FXML scenes, code from which I took an example on the internet, follows the code: @FXML private…
-
0
votes1
answer27
viewsAndroid Studio java: listview in an Activity, send information to her from another Activity
The code of the list: public class Main2Activity extends Activity { //Atributos private SQLiteDatabase bancoDados; private ArrayAdapter<String> itensAdaptador; private ArrayList<String>…
-
0
votes1
answer97
viewsPress factorization using Stack
I made a stack with vector, with basic functions (push, pop, Peek) and with it I want to make a prime factorization of a value. I made the program, but when I compile it, it is in an infinite loop…
-
0
votes0
answers21
viewsAdding Components to a Jframe
Hello, I’m trying to build a simple interface to implement a minefield. The end result should be something like a grid of buttons, very simple. The problem I’m having is that when I create a class…
-
0
votes2
answers60
viewsProblems displaying an array of functionalities in a Main class
I have 3 classes involved in this error: Testaempresa, Empresa,. My idea is to create an array of employees within Company and print in Testaempresa. For this I made within Funcio a method called…
javaasked 6 years, 7 months ago Gabriel Silva 169 -
0
votes1
answer180
viewsQuery with multiple Ids and date with JPA and Spring via Restapi
Good morning, I’m trying to set up a query with Spring JPA and Rest where I can insert several Ids and initial and final date. The query works if I only put an ID with the dates. The code is like…
-
0
votes1
answer123
viewsInfinite Loop in Exception Handling
I’m trying to make a try to ask for the option number for the user, but I want to do this until he type an integer number, I did a Try/catch, but when I run it and digit a string it keeps sending an…
-
0
votes0
answers35
viewsAndroid TCP client does not work
Good Afternoon, I’m creating an application in android studio to send a string from smartphone to pc. My application has the following code: public void Send_Command(View v) { testClass();…
-
0
votes1
answer80
viewsCasting error
I have a program that works with the inverse Polish notation, which is, when we have an operation ((2+3)8), in Polish notation stands "23+8". I already managed to pass the operation to the Polish…
-
0
votes1
answer69
viewsData from a Selected Recyclerview
Good afternoon, I need that when the person clicks on a take the data from Animeactivity and is passed to Start screen ? insert image description here…
-
0
votes1
answer177
viewsJSF and Javascript
I have the following question: How JSF works with Javascript ? I’ll be more specific. I’m in a project where I’m using JSF (primefaces), but I can’t do anything simple with Javascript, which would…
-
0
votes1
answer3380
viewsTake value from an application.properties property - Spring Boot
I’m a starter at Spring Boot. I have a project in Spring Boot q has a application.properties and inside there is a property with a value (spring.datasource.username=user) and I want to take this…
-
0
votes1
answer56
viewsRename Imageview to Upload
Good morning, I would like to ask a question, my APP so far the guy takes a photo of the phone and is in an Imageview (Ex: img1), I need to be created a name defined by me in an example variable:…
-
0
votes1
answer143
viewsWhy do these two identical codes, one in C++ and the other in Java, give different results?
I’m trying to solve an issue in the URI Online Judge in Java but I’m afraid of 5% error, and what I’ve studied is being caused by the fact that the accuracy of variables in C++ and Java is…
-
0
votes1
answer130
viewsKeyholder.getKey() can return null - Spring Boot Jdbctemplate
The thing is, I’m a beginner in Spring and I’m doing a method that will insert a new row into a database table and this method will return the Id new that was generated by the Bank, I am doing this…
-
0
votes0
answers64
viewsI can’t set in textField JAVA
I have this frame, where clicking the 'SEARCH PRODUCT' button opens another frame with the list of registered products: public class GeracaoOcamento extends javax.swing.JFrame { public…
-
0
votes1
answer140
viewsHow to display objects from a list?
I have the Personal class which has the following method: public List<Pessoa> BuscarTodos() { List<Pessoa> list = null; EntityManager em = getEM(); try { list = em.createQuery("select t…
-
0
votes1
answer94
viewsMethod using JAVA thread and inheritance
I am trying to create a class Balldefutebol that receives attributes of the class father Ball, the class ball possesses the attributes private int ar = 100; //100% private boolean furada = false;…
javaasked 6 years, 7 months ago Marcelo Henrique 33 -
0
votes0
answers2129
viewsMystery of the 4 A3 cards with CKR_DEVICE_ERROR in Keystore load, I need a light!
I’m dealing with a mystery in a client’s authentication Webservice with a Serasa A3 card, it always gives the following error when I try to load the Keystore:…
-
0
votes0
answers71
viewsConvert String with multiple values to arraylist and add programmatically into a spinner?
((I am using the browser to enter the site, because app here is problem) I’m pulling several results from formats of a video on Youtube. However, when I step into the spinner only one result passes,…
-
0
votes2
answers2460
viewsExport. xlsx with Java
I am trying to export a spreadsheet with Java, specifically a file .xlsx, but I’m not getting it. I’m doing it this way and it’s working, but it only works by putting the extension .xls:…
-
0
votes0
answers49
viewsSlow reading of a very large string
I’m missing a lot of performace doing a decodeBase64, when I have a very large file type 30MB, it takes a long time to read the data received from the front. Is there any way to improve the reading…
-
0
votes1
answer33
viewsI need to make the igName() method return if they are the same or different. I made the comparison with double and function, but with String the if does not compare
Computer package Exercício06_Aula8; import Objeto.Objeto; public class Computador { private double ck; private double hd; private String nome; public void setCk(double ck) { this.ck=ck; } public…
-
0
votes1
answer443
viewsHow do I pass a lambda function as a parameter?
I’m doing a college project where I have to develop a calculator with Java. I am trying to find a way to pass lambda functions as a parameter so that it is possible to put these functions inside a…
-
0
votes1
answer159
viewsRead xml with Xstream
I have a java xml reading exercise. My teacher indicated using the Xstream library and I’m not getting it. I read about the documentation, but I can’t identify the problem. I have the Transaction…
-
0
votes1
answer35
viewsProblem entering data into Firibird database
I have this error when I will enter data in the database.... I will send the code and error ... sorry I’m new conexao banco /* * To change this license header, choose License Headers in Project…
javaasked 6 years, 7 months ago Willian Wenzeel 1 -
0
votes1
answer210
viewsSwitch from second to third Activity [Android Studio]
How do I switch from the second to the third screen?? I managed to switch from tela1 to tela2 (from Main for CadastroActivity) But using the same code, I can’t get from screen 2 to 3 (from…
-
0
votes1
answer25
viewsError in BD/list
I was following a tutorial on how to CRUD, but an error appeared to me (in the tutorial is ok) How do I fix it? lista = (ListView) findViewById(R.id.lista_Madicamentos);…
-
0
votes1
answer142
viewsWhat is the correct way to run a web application in eclipse?
I am studying JSF using the eclipse IDE, but am finding a certain problem when running my application. When I run the application by clicking on the project itself, it doesn’t seem to load my…
-
0
votes2
answers66
viewsError in list/BD
I have an error in this excerpt (appears the whole stretch of red), what is wrong? lista.setOnLongClickListener(new AdapterView.OnItemLongClickListener(){ //clique longo, para selecionar a linha…
-
0
votes1
answer4449
viewsHow to fix these and other errors: Failed to Convert from type [java.lang.String] to type [java.lang.Long] for value 'list'?
I’m implementing an example of a book about Spring Boot, but, after executing, while trying to access the route /clientes/list or else, /clientes/view in the browser appear the following errors:…
-
0
votes1
answer135
viewsHow to manipulate a Json Object before returning to the API
Hello I have this method in my controller: @GetMapping(value="/{id}/perfil", produces = MediaType.APPLICATION_JSON_VALUE) public String carregarPerfilUsuario(@PathVariable("id") Long id,…
-
0
votes0
answers42
viewsRegistration N to N (many to many), where I need to send an Array according to the image
I am making a registration N for N (many for many), where I need to send according to the image an Array of medicines, Unit and posology. The question is how to take this Array in just one request…
-
0
votes1
answer98
viewsError in JSP page
Good evening, everyone, I am making a page in JSP, where the user informs 2 values and through a method, I do the sum of these 2 values and presents just below the value of the result. However the…
-
0
votes2
answers449
viewsError opening another Activity
Error that appears: 2018-10-16 00:31:04.280 9433-9433/? E/AndroidRuntime: FATAL EXCEPTION: main Process: imobmobile.br.com.imobmobile, PID: 9433 java.lang.RuntimeException: Unable to start activity…
-
0
votes0
answers166
viewsTransfer objects between Ragments
Good evening.. I’m a beginner in Java Android and I’m developing an application to be used on Gertec’s credit card machine. However my application will have other forms of payment besides card…
-
0
votes1
answer114
viewsHow to position a browser within another Jframe interface?
I am developing a project in Java to simulate a proxy server with authentication that presents a single interface, in which several internal frames are arranged inside it. How to position a browser…
-
0
votes0
answers106
viewsJava CRUD problem using Mysql
In my DAO class, I have the method to enter in the database, but in my system screen I can only update the fields if I make a change in all fields. Example: my table has 4 fields and I only modify…
-
0
votes0
answers119
viewsRun application . jar made in swing
I created a simple calculator, with just the add-on function. Running the IDE works normally. So I built and tried to run the application outside the IDE, but I was not successful. You could tell me…
-
0
votes1
answer311
viewsHow to convert Jsonarray to Arraylist<> on android
Hello, all right? I would like your help to be able to convert a Jsonarray to Arraylist<> on android. I make a request that returns me the following Json: {"normal":{"test_graph":{"VALORES…
-
0
votes1
answer163
viewsNullpointer when using Cucumber and Rest-Assured
I’m performing an API test using Cucumber and Rest-Assured, but in the call I use Rest-Assured is being returned a NullPointer. My Feature: Scenario: Parâmetros não foram informados Given A API de…
-
0
votes0
answers27
viewsDWR - Null classes
Expensive I’m having trouble injecting the classes by calling some methods using DWR with Hibernate. Code: @Controller @Transactional public class ManterArvoreClassificacaoController { @Autowired…
java ajax framework dependency-injection instantiate-objectasked 6 years, 6 months ago Kennedy Anderson 90 -
0
votes1
answer69
viewsDoubt Javamail - Attachments coming null
I have an application that downloads the attachments that are sent in a certain e-mail and works perfectly. There arose the need to do the same thing in another email. The two are gmail. However,…
-
0
votes1
answer169
viewsButton to return to an Intent
My problem is: Back from an Activity to an Internet. I have the following sequence of pages: -MainActivity -Intent(Escolher foto) -DadosActivity In Mainactivity I have a button to open an Intent so…
-
0
votes1
answer56
viewsListview of Android slow
What may be causing slowness? Code of Adaptador: public class Adaptador extends BaseAdapter{ private static LayoutInflater inflater = null; Context contexto; String[][] datos; int[] datosImg; public…