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
answers22
views -
0
votes1
answer391
viewsLocation in the background android studio
---------- This is my service public class LocationMonitoringService extends Service implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {…
-
0
votes1
answer241
viewsSplit Array into Multiple Threads
I need to do a Query in my Database, which will return each of the Lines. However, for each of them, during the Return, I need to wait about 5 seconds, because it is the time I need to wait for Ping…
-
0
votes1
answer33
viewsRetrieve the containsKey()
Good afternoon, I’m starting to use Android Studio, in the following situation I’m stuck: have the Mainactivity where through a recyclerView I have a listing, by clicking on one of these listings…
-
0
votes1
answer94
viewsGo from main activity to fragment
I’m building an app on Android and in it will have among the various activities a Fragment for user profile. The problem is that it would need, from the profile selection, to go from the main…
-
0
votes1
answer592
viewsDisable Jframe Maximize Boot
I set the size to 600x600, but I wanted to know how I do so that when I click on the maximize, I don’t run out of the background or even take out the maximize button and just let it minimize and…
-
0
votes2
answers443
viewsDisplay date correctly on a Jtable
I am unable to display the sql database date type Date in Jtable, the date appears that way: I use the following method to call the table data: public ArrayList<Alunos> read(){…
-
0
votes1
answer202
viewsSearching more than 1 field with Findby in spring mvc
I have this repository: public interface RepositorioUsuarioPermissao extends JpaRepository<UsuarioPermissao, Long> { @Query("SELECT u FROM UsuarioPermissao u WHERE u.id_seletivo = ?1 and…
-
0
votes0
answers23
viewsNullpointerexception
I have a button that takes 2 text fields and sends to Mysql by MVC standard only it is giving a java.lang.Nullpointerexception q do not know how to solve The code of the button private void…
-
0
votes2
answers261
viewsMultithread and Data Competition + Spring
I am rewriting a software that serves as a communication bridge between two services. Communication is done via sockets. The environment has high data competition, especially a list of active…
-
0
votes2
answers40
viewsError trying to run firebase forgot-password
I am making the password forgot screen of firebase and is giving an error when I put the . sendPasswordResetEmail. That’s the version of my firebase : implementation…
-
0
votes0
answers500
viewsHTTP Status 500 - Internal Server Error
After trying to make a call in the Glasfish Webservice is occurring the error below, I am trying to make a call in the Webservice Rest Json, in the XML Rest call it runs normally. package…
-
0
votes2
answers114
viewserror in reading JSON
I have a code to read Json, in my test environment it works 100%, but when I change to read another Json with other parameters it accuses Unexpected token COLON(:) at position 45. at…
-
0
votes1
answer1971
viewsHow to make a program calculate the area of several objects separately using the values given by the user (scanner)
I am new here and new in programming, I believe that the best way to establish the concepts and learn is in practice. So I tried to do some basic programming on Eclipse (also use Intellij) and at…
javaasked 6 years, 5 months ago Kevin Ricci 165 -
0
votes1
answer395
viewsNull Pointer Exception?
In the code snippet below, you are supposed to compare the value of the items in the array linhas with the String inserted by the user p. It’s working, but there’s always the error: Stack trace -…
-
0
votes1
answer323
views2 form on the same page with Spring mvc, Thymeleaf, anyone know how?
This Physician registration screen, then I created this modal for the user to register specialties. @GetMapping("/cadastro") public ModelAndView preSalvar(@ModelAttribute("medico") Medico…
-
0
votes1
answer480
viewsSyntax error on token "Else", delete this token
if(comando == "w"); { System.out.println("Você foi para o norte."); System.out.println("Um inimigo surgiu!!! Oque deseja fazer? (a = atacar e f = fugir)"); comando = in.nextLine(); if(comando ==…
-
0
votes1
answer128
viewsError in PDF download: Unknown Protocol: c
I am trying to download a PDF file using JSF.. But when executing the method, Exception is launched. My Method: public void download(String pathUrl) throws IOException { FacesContext facesContext =…
-
0
votes1
answer112
viewsProblems to close communication with the database
I have some applications consuming data from the database, but for a while now the applications are not able to close the connection, when I give a conexao.close(); Java says it cannot close because…
-
0
votes1
answer541
viewsTake the value of a variable in Seekbar - Java / Android
I am a beginner in Java / Android and I am developing an application with image processing. I already have the application working with the necessary filters. In case I have: Canny(edges, edges,…
-
0
votes3
answers245
viewsReturn a SELECT * FROM" in the Javaweb browser
Hello guys I am studying Javaweb and I came across a boring mistake!! I’ve done a lot of research on the subject but I couldn’t solve this mistake. I have this method that is pulling all data from…
-
0
votes3
answers1359
viewsHow to resolve ERROR: HHH000346: Error During Managed flush [org.hibernate.Exception.Sqlgrammarexception: could not execute statement]
When I try to run my test class I get this error below. I don’t know what else to do, when I comment on the attribute FOLDERAUTOUPDATE class ApplicationItv the insertion in the bank works, but I…
-
0
votes1
answer338
viewsHow to set values in Enum?
Look at the Grid The record that is coming from the database is of an Enum class, the correct one was for the result in the grid to be printed name Value and not V. This is the Enum; VALOR("V",…
-
0
votes0
answers215
viewsCompress Android Studio File
I’m trying to compress my File which in case is an image but it keeps going with sizes above 4MB someone would help me. Follows code below: @Override protected void onActivityResult(int requestCode,…
-
0
votes1
answer128
viewsJscrollpane track which component is focused
I have a screen with a JSrollPane and several JTextFields. When I change textfield using the key tab, the JScrollPane does not track if the textfield that receives the focus is "below the screen". I…
-
0
votes0
answers47
viewsI’m trying to upload an image but I can’t. (beginner)
While I was doing a course of games for java, I was trying to load a Sprite/image and the following error appeared on the console Exception in thread "main" java.lang.NullPointerException at…
javaasked 6 years, 5 months ago Apenas Alguém 1 -
0
votes1
answer35
viewsAuxiliary tablet with composite PK
I have a supplier table: @Entity(name = "tbl_fornecedor") public class Fornecedor extends PessoaJuridica implements Serializable, Desativar { private static final long serialVersionUID = 1L; @Id…
-
0
votes1
answer337
viewsHow do I take values from a row that are in a jstl list and send them into the respective input text on the same jsp page?
Good afternoon guys! I’m using "Jsp, Servlets, and jstl". I have a list where I have a link called change, when I click I get the values from that list line and send to the same jsp where there is a…
-
0
votes2
answers171
viewsHow to reference methods that use array as an object in the console?
I have a class with the following attributes and constructor: private Person[] persons; private int personCount; public PersonDatabase(int defaultPersonsCapacity){ persons = new…
-
0
votes2
answers689
viewsSend List + Parameter to Controller
I am trying to send a list and parameter to my controller. My controller is as follows: @RequestMapping("/lista-receitas") @ResponseBody public String recebeLista(@RequestBody List<Receita>…
-
0
votes1
answer32
viewsjava.lang.Illegalmonitorstateexception
The method LeaveServer is in a class called ServerData, and serves to put an open server when the client so wishes. The method notifyall has been implemented in another class where contains all…
-
0
votes0
answers33
viewsAndroid: Data does not persist in Mysql
Good Afternoon, With the code below I get a success message when executing the method, but the data is not in the table when validating whether it was persisted in the database (Mysql). public class…
-
0
votes1
answer71
viewsHow to Download SQL Server File using Servlet
I have a basic application where I save files in the database SQL Server using Java, the part of insert into the bank I’ve done, I’d like to know how to download the file that is in the bank via…
-
0
votes1
answer45
viewsAndroid Htppget URL Connection
I’m trying to make an httpget connection from android to php, I made all php code connecting to mysql but starts giving error from after "urlConnection = ..." protected String…
-
0
votes1
answer39
viewsjava.net.Proxy problem with Marshmallow and versions below
I have the following test : package com.technopartner.technosdk.proxy; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import…
-
0
votes0
answers89
viewsDisplay static map Google with Picasso on Android
I am developing an app by Android Studio, I would like to create a Recyclerview where you have an Imageview and upload a static image of a determining point on the map. As here:…
-
0
votes0
answers50
viewsObject Link
I am developing an application and came across the following "problem": @RequestMapping("/pagamentos") public ModelAndView pagamentos(FormaPagamento pagamento){ ModelAndView model = new…
-
0
votes0
answers288
viewsJava: Converting HTML to PDF with special characters
I’m new to the group, and I was wondering if someone could give me a hand. I am trying to create a report for a web application. I am trying to take an html with the text and several 'tags' that I…
-
0
votes1
answer559
viewsRetrofit = Manipulating the Sponse
Well, I’m asking for more help from friends so really, I’m not getting the dynamics. Following tutorials and explanations here from the forum I am TRYING to use the Retrofit but it’s not working. I…
-
0
votes0
answers44
viewsStackoverflowerror when trying to call recursive method
I’m developing an image editor Paint, and I can’t do the paint bucket method, the idea is: (example) I have an 8x8 matrix and the possible values in this example are "-", "X" or "O" 0 1 2 3 4 5 6 7…
-
0
votes0
answers34
viewsRadio Player Android Parando
So I have the following Activity below. In it, I have a radio player. However, when I minimize the App to see something else, such as using the calculator, the player stops playing. I’m using the…
-
0
votes1
answer145
viewsJSON to POJO returning Null
I’m making a request for the site’s API swapi and whenever I do the conversion from JSON to POJO, I get the NULL return RestTemplate restTemplate = new RestTemplate(); String fooResourceUrl =…
-
0
votes2
answers456
viewsOpen an Activity by clicking an item in a list view
I’m a little lost already, I want that when click on an item in the list it opens another Activity, but only with Toast... I’m beginner so if you can help me thank. public class estatisticas extends…
-
0
votes1
answer577
viewsFirebase does not save data
so I’m having a little problem and I can’t solve it for studies I’m creating an app already famous and my doubt is the following when registering a user your name and email are not recorded in the…
-
0
votes2
answers166
viewsVector (array) log-in validation. java
I’m studying vectors in object orientation and decided to do a little program to put some things into practice. It consists of making the record of n vectors that will be bank accounts with name,…
javaasked 6 years, 4 months ago Kevin Ricci 165 -
0
votes1
answer22
viewsHow to include unit test artifacts in a simple Java application?
This is my project in my repository; PROJECT Note the pom.xml file <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"…
-
0
votes1
answer35
viewsOpen Activity by clicking an item in a custom listview
I created a custom listview, it’s all right, I tried it here but it’s not right, I wanted to implement the click on an item, but since it’s custom listview maybe it’s something different, I’m a…
-
0
votes1
answer58
viewsCreate Foreign Key Hibernate
Solved and edited the correct line: I cannot include a invoice with the customer’s id. In this case the customer may have several tax notes assigned to him. I am able to register the NF correctly,…
javaasked 6 years, 4 months ago Sergio Guerjik 233 -
0
votes2
answers101
viewsScheduling problem for sending notices by e-mail Spring and Javamailsender
Good morning, I am using spring with Scheduled, before I used Quartz but as I uploaded the version of spring I decided to abandon Quartz since the first option was enough to meet my need. In short,…
-
0
votes2
answers148
viewsItem selected in p:selectOneMenu reaches null in Systener
I have a p:selectOneMenu, with data coming from the database, within a p:dialog, along with a p:messages and other fields. I want to perform an action (Display some messages) when selecting a…