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
answer71
viewsReferencing components of Activity
I searched but found no answer. I need to access a TextView that is present in my Activity within a Java Class that is independent of the Java Class itself Activity. The way I tried was by creating…
-
1
votes1
answer127
viewsError: Thymeleaf is disabling the responsiveness of my Bootstrap form. How to resolve?
I’m creating a small web application to learn more about Spring Boot. I’m using the Thymeleaf as engine HTML and the Bootstrap as framework front-end. The problem is that I don’t know why, and I…
-
1
votes1
answer75
viewsHow to keep the same object between requests in Spring MVC?
I want to add the items to the same object Request dynamically, but always instantiating a new Request. @GetMapping("/novo") public ModelAndView preSalvar(@ModelAttribute ("pedido") Pedido Pedido){…
-
1
votes1
answer67
viewsList<> getResults returns list with equal elements
Hello. I have the following table in mysql: create table resultado( data varchar(10), premio varchar(3), loteria varchar(5), milhar varchar(10), primary key(data, premio, loteria) ); The class that…
-
1
votes1
answer53
viewsInsert multiple Markers into Maps
I found a code here on the site, I put in my project but it didn’t work, anyone knows how I can solve? The method below is called in onViewCreated() Note: I am using the Map inside a Fragment, it…
java android android-studio android-fragment google-maps-android-api-2asked 5 years, 11 months ago Elailson Silva 11 -
1
votes0
answers104
viewsReturning number of Sqlite records and displaying in Textview
I have an app and I need to display in a TextView the amount of records stored. public int contagem(){ createBank = new CreateBank(this); connecting = createBank.getReadableDatabase(); String cursor…
-
1
votes1
answer78
viewsGetting a response from Webservice with Ksoap
I have a web service that returns this data: <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"…
-
1
votes0
answers27
views -
1
votes1
answer219
viewsHow to access methods of an object array?
I am doing a work of the college in which I have to develop a banking system, for this I have 3 types of account (1 class for each type), therefore I want to use an array of generic objects. The…
-
1
votes0
answers1535
viewsHow to consume a java SOAP Web Service that requires User and Password?
I am trying to consume a SOAP web service using Netbeans IDE (JAVA), but when I try to delete a list it returns null to me. Talking to a colleague, he told me that it is for lack the user and…
-
1
votes1
answer39
viewsIncompatible types when trying to start a class with the "switch" value of another Java
I got the following: public class Bullet { public enum Direcao { UP,DOWN,LEFT,RIGHT }; // Posição do tiro em pixels. private int x,y; // Direção do tiro. private Direcao direção; // Este tiro está…
-
1
votes0
answers57
viewsProblem with JAVA paths
I am on a project and I find myself with the following problem. a part of the code has the following: Path caminho2 = Paths.get("C:\\Users\\Evandro\\Documents\\Java\\Player beta…
-
1
votes0
answers34
viewsNot returning returning the json
Good I’m starting in the android area and still do not know much about it and would like help with the following code: gridView = (GridView) findViewById(R.id.lastedAnimeView);…
-
1
votes1
answer79
viewsError calling add in a Hashset
Every time I try to create a objeto.add(); and put the attribute in it, it continue to give me an error. See my code: public class Agencia { private String nome; private String endr;…
-
1
votes0
answers44
viewsJSF + Primefaces = Fullajaxexceptionhandler
I am developing an application using JSF + Primefaces, in the code of a screen has the following button <b:commandButton value="Pesquisar" look="primary" style="width:100%" process="@form"…
-
1
votes1
answer82
viewsI can’t display anything in a JSF view
I’m working on a web application to develop a module, but I can’t display anything in the view, not even a simple message. The view loads the template, but does not display anything I put in the…
-
1
votes1
answer37
viewsQuery returns another user’s value
I am not able to compare the code (from the logged in professional) with the hired code (which should be the same as the logged professional) in sql query and this makes the query return a value of…
-
1
votes0
answers24
viewsError while using Servlet resources
Good evening colleagues, Please, I need your help to understand what’s going wrong, I have the following form: form action="CronogramaNegocio" method="get"> <div class="col-md-3…
-
1
votes1
answer79
viewsJava Jfilechooser doubt code
I understood that here I urge the class JFileChooser: JFileChooser arquivo = new JFileChooser(); I take the file object and call the class method JFileChooser(correct me if I’m wrong):…
javaasked 5 years, 11 months ago Edenilson Conceição 109 -
1
votes0
answers22
viewsI need to save parameters in several tables
I’m returning some parameters and need to dismember these parameters saving in two tables. Follow the initial code: lamina.controller.js function salvar() { // remove a mensagem de sucesso delete…
-
1
votes1
answer273
viewsProblem when trying to encrypt and decrypt using RSA
Hello, I’m making a program that encrypts a user-generated file and then decrypts the encrypted file showing the original message. Nor the RSA implementation code of Bouncing Castle but saving the…
-
1
votes2
answers66
viewsReturn data from a subobject
Below is what I implemented until then: public class Interface { private List<Usuario> usuarios = new ArrayList(); private List<Tarefa> tarefas = new ArrayList(); Menu menu = new Menu();…
-
1
votes1
answer136
viewsLabel does not update via setText in Javafx
Good night, I have a problem trying to change the text of a label through the sexText method and I can’t identify the problem, I appreciate the help. Code: void atualizar() {…
-
1
votes0
answers21
viewsDatatable page two deletes List
I’m using Primefaces 6.2 with Hibernate 4.3 without JPA or Spring. I need to show data on the screen, where I have a Dialog and inside it a Datatable with a button that will open another Dialog. I…
-
1
votes1
answer134
viewsHow to perform an action automatically at the end of a video?
Follow the video code package video; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.layout.StackPane; import javafx.scene.media.Media; import…
-
1
votes0
answers122
viewsHeroku - Sharing databases across applications
I created a Python/Django app and published it in Heroku. (My database) Now I have a Java/Spring Boot API that is also in Heroku. (Rest API) But it connects in the base created by Django which is…
-
1
votes0
answers22
viewsJscrollpane producing glitches on the screen
I have little experience with Java Swing and am getting beat up with one simple thing. The code below produces glitches (artifacts/dirt) on the screen when the scroll bar is dragged repeatedly and I…
-
1
votes1
answer140
viewsDistribution of components in Grouplayout
The example below has a GroupLayout which contains two elements, a custom search and filter bar (JPanelSearchAndFilter) and a JScrollPane. When it runs and then the window is maximized you can…
-
1
votes1
answer53
viewsDo not re-enter an existing login user
I have a JPA problem with Java. I built a login system, using a self-generated ID, but every time I run the program it creates another user in the database, with a different id but same credentials.…
-
1
votes0
answers54
viewsProblem in crossing parameters between screens in Javafx
Friends, this is my main start method of a Javafx project. The idea was for me to store a cache of all the screens so that I could pass objects between the screens through the Observer Pattern. The…
-
1
votes1
answer122
viewsData from an object is null after reading from a CSV
I have the following Java class: public class Pessoa { private String employee_name; private String user_id; private String domain; private String email; private String role; @Override public String…
-
1
votes0
answers26
viewsNullpointexception problem in JSF and Primefaces
Good afternoon! I am having problems with a xhtml form made in JSF, because it is not setting the values in Usuariobean, and when I will execute the method register() present in the class…
-
1
votes1
answer115
viewsHow to stop a service?
I created a VPN connection in my app through a service, at the click of a button, the connection is made. But now I want to know how to do the reverse, IE, by clicking the button disable this…
-
1
votes1
answer1117
viewsError converting JSON. (com.google.gson.stream.Malformedjsonexception)
I am developing a program that needs to communicate with an online store, all communication is done via HTTP requests and has as response a JSON. Displays the error…
-
1
votes2
answers54
viewsGetting id wrong
In the small project I am doing, the user enters his login and password. The system makes a POST for a URL and checks the answer. If you log in, it returns some things like the user ID, email and…
-
1
votes1
answer227
viewsHow to reduce the spacing between items in Boxlayout?
In my example, the class Teste is a JPanel with BorderLayout. Within the central region of this layout there is a JScrollPane containing another JPanel with BoxLayout vertically. The intention is…
-
1
votes1
answer1026
viewsConvert Java object to JSON with Gson (generating with backslash)
I am trying to generate a JSON based on a Java object. JSON is being generated, but some bars have been included improperly: import java.io.Serializable; import…
-
1
votes1
answer456
viewsCreating a new Object, and populating its properties, using Java Reflection
Hello, I need to invoke a method via reflection, Method.invoke(Objeto, arg); Object -> Object created from Class.newInstance() Arg -> is the value I want to pass. And I know it’s a String. But…
-
1
votes0
answers73
viewsMethods call using RMI in JAVA
I’m starting to work with remote procedures in JAVA and I’m having trouble calling methods in sequence. In the code below, when I invoke the sayHello() method through the stub, the code works…
-
1
votes0
answers23
viewsDifference between Hoare vs Java Monitor
I’m trying to figure out something I haven’t quite figured out yet why. In my book of SD, you present the following statement: Nos monitores de Hoare, se uma thread (dentro do monitor) executa…
javaasked 5 years, 10 months ago gabrielfalieri 1,231 -
1
votes0
answers22
viewsClient to receive data from a Server-Push
I’m trying to create a client to consume data from an interface that receives data from a gateway. This interface implements a server-push that needs to be started from a client-made PUT request.…
-
1
votes0
answers29
viewsSqlite does not input data into the database during an Asynctask
I’m trying to add data to DB inside an Asynctask. In it I catch the Inputstream coming from an httpURLConnection, I interpret the JSON and saved in the local Sqlite. But I don’t even know if this is…
-
1
votes1
answer960
viewsjava.lang.String cannot be cast to Ljava.lang.Object
Trying to list items in a ui:repeat that is inside another, and need to use as parameter the id of the ui:repeat item more external. But I can’t do it because the following error is occurring:…
-
1
votes0
answers57
viewsDoubt Apache POI
How many drop-down lists apache poi/excel 2016 supports ? I ask this, because I am working with a code that dynamically generates a spreadsheet with several dynamic lists, which depending on the…
-
1
votes1
answer1575
viewsReceiving object by parameter
I’m using Spring MVC and use some mapping to receive an object for example and access that specific object in controller. For example: @GetMapping("/pessoa/{idPessoa}") public ModelAndView…
-
1
votes1
answer103
viewsAdd Jsonobject to List<Discipline>
I’m having problems when I add data to a List. I have the following code that takes the return of a Jsonobject and adds it to a List. Then I move on to the InicialAdapter.java DisciplinaTask…
-
1
votes0
answers62
viewsJava web, jstl :How to execute a method in Servlet when exiting an input text ex:"check whether the name availability for registration"
How to execute a method when exiting a input text. Example I will make a registration at the time of registering as a user I want to check if that name is available to be used , and can not accept…
-
1
votes2
answers167
viewsRecover Spinner’s position to use in another Spinner from another Acitivity
I have a Banknote Registration App that has 1 spinner. Spinner contains card registration with Idcard, title and description (Saved in a "Card" table in the database). When save this register from…
-
1
votes0
answers29
viewsProblems with localization request
Hello, good afternoon! I am having problems with the return of my location in my code (it is also not asking permission to the user) CODE OF ACTIVITY public class GPSActivity extends…
java android android-studio google-maps android-permissionasked 5 years, 9 months ago Gabriel Júnior de Souza 13 -
1
votes1
answer199
viewsproblems with Strictmode.Threadpolicy
Hello, I have the link below http://www.hotplateprensas.com.br/ws/clientest.php that delivers me a string json of the kind { "clientes":[ { "idClientesT":"1", "tipo":"s", "nome":"Carlos"}, {…