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
answer48
viewsProblem returning a vector list
I’m doing a Java Project and I’m having a hard time dealing with vectors. In the project I have the following methods to create: 1 - Create a method that receives as parameter the course name and…
-
0
votes0
answers541
viewsHow can I make an Oauth2 authentication from a native android app with a site developed with wordpress?
I have a site developed with wordpress, and not on the wordpress platform.com . Lately I have been doing tests to use restfull and consume the data via json by native android application. Only that…
-
0
votes1
answer79
viewsWhat happens internally when we use request.getRequestDispatcher?
When we use the request.getRequestDispatcher() he does the forwarding of the request for another Let to be met (correct?). The question I wanted to know is: internally, it does this invocation (I…
-
0
votes1
answer31
viewsHow do I download a file that is in Storage by my app (Adnroid Studio)
I took a look at the documentation provided by Firebase and still did not understand how to download a file that is in Storage by my app using Android Studio, someone can help me?
-
0
votes1
answer100
viewsAlgorithm of Division and Conquest
I’m having trouble making a division and conquest algorithm of the sum of the elements of an arrangement. public static int somatorio(int[] a, int numElem) { if(numElem == 0) { return 0; }else…
-
0
votes1
answer97
viewsConcurrent list modification can cause "java.lang.Illegalargumentexception"?
I have a multi-threaded program that makes concurrent modifications to an unsynchronized list (by bad design decision). Sometimes, in a seemingly unpredictable way, I get…
-
0
votes0
answers664
viewsHow to save a Base64 to a mysql database?
I am creating an application using Angularjs and using webservlets with mysql database connection. To generate the binary, I use the following code: $scope.adicionarArquivo = function (element) {…
-
0
votes1
answer35
viewsPlay a series of audios on android
Good evening, has anyone done or knows how to play a series of audios ? I am trying to make an app similar to that game Genius. And I would like to be able to play a sequence of audios that I will…
-
0
votes1
answer953
viewsHow to make Ajax requests in Java
Good Morning I’m developing a web application where I need something simple: when the user selects a state in a Combobox, the system shall update another Combobox with all cities. I am programmer .…
-
0
votes1
answer529
viewsSend a Servlet object array to a jsp page
I need some help I have a Servlet that returns an array object p with a select query. I would like to know how to display this object in my jsp in HTML input fields (text box)
-
0
votes1
answer70
viewsApply setItemOnClickListener to Gridview Buttons. Kotlin or Java
I made a gridView of buttons, but when I use the setOnItemClickListener method to trigger the respective buttons, it does not work. I want to use the buttons so I can trigger an Intent, knowing that…
-
0
votes2
answers337
viewsJSF tags are not being converted to HTML
I created a Maven project in Eclipse to use JSF and made all the settings the material asked for. However, when I created a XHTML file and went around in the browser, the source code of the page was…
-
0
votes1
answer85
viewsIs it possible to open on a given PDF page?
public static void main(String[] args) throws IOException, BiffException { Workbook workbook = Workbook.getWorkbook(new File("C:\\testes\\teste.xls")); Sheet sheet = workbook.getSheet(0); int linhas…
-
0
votes0
answers294
views -
0
votes1
answer47
viewsInsert record into a table and use newly generated ID to insert record into related table
I have a insert where I save a record, and need to use the result of the saved value in another insert. Empresa emp = new Empresa(); emp.setId(1); emp.setNome("Nome da empresa");…
-
0
votes1
answer2005
viewsnot-null Property References a null or Transient value
When I try to save a city, it shows not-null error, but looking, I can’t find a solution when looking for the controller, I understand the error, but in my project. Caused by:…
-
0
votes1
answer132
viewsReturn search HQL JAVA
I have the following function that searches in BD a user that satisfies the login and password passed by parameter: public Usuario getUsuarioLogin(String pLogin, String pSenha) { String hql = "…
-
0
votes1
answer3702
viewsJava Daylight Saving Time - (Daylight Saving Time)
We changed the entry time of summer time 2018 on the Operating System (Linux or Windows), but the JAVA application shows the wrong time (daylight saving time).
-
0
votes0
answers69
viewsProblem with API authentication in android studio
I’m having trouble authenticating an UBER clone running on Android Studio. The API runs in the main class: package com.uber.sdk.rides.samples.cmdline; import…
-
0
votes0
answers119
viewsReceive a json as Java Servlet parameter
I’m developing a API using java Servlet, would like to know how do I receive a JSON in the body of the request as parameter and save to a database? Example: { "nome": "José da Silva", "email":…
-
0
votes1
answer208
viewsHow to change GPS location icon in Android Studio?
I wanted to know how to change that red icon that marks the location of the GPS to place a picture located on the drawable. I just wanted to know what code I should add to get the suggested result.…
-
0
votes1
answer119
viewsError java.lang.Nosuchmethoderogate: Mainactivity.checkSelfPermission
I am making several attempts, but I cannot get the current location of a user using the Location API. I am running the following example: public class MainActivity extends AppCompatActivity…
-
0
votes1
answer77
viewsInsert data, convert Int to String
The error happens pq in the Funcio_dao() class, the variables with error are declared as INT, I can’t remember which code to correct conversion.…
javaasked 5 years, 11 months ago Gustavo Freire 87 -
0
votes0
answers220
viewsjava.lang.Runtimeexception: Unable to start Activity Componentinfo{}: java.lang.Nullpointerexception by checking my input
I’m new to android development and am passing a swing chat for android. The idea is to use a server socket that makes the connection. This is the third attempt to make it work... I received the…
-
0
votes1
answer277
viewsProblems with paging on Jtable
I am creating an application where I fill the data of a table through the database, but there are many so I wanted to organize better. However, the results shown in the table are not constant. The…
-
0
votes1
answer78
viewsandroid:layout_height="fill_parent" from Viewpager does not work
I have a ViewPage that does not work the android:layout_height="fill_parent", shows nothing on the screen, but if I determine an ex value: android:layout_height="500dp" the determined height…
-
0
votes1
answer679
viewsjava.lang.Nullpointerexception error on android application
In this code occurs the cited error, pointing to the method CarregarTelaPrincipal(). Why is it happening? package com.example.usuario.myapp; import android.app.Activity; import…
-
0
votes0
answers162
viewsError while doing Hibernate relationship with Java
Good afternoon guys! I have a question in Hibernate. I have the following case Person - Client - Supplier But I’m having trouble making the relationship. follows my codes New Error 18:50:34,405…
-
0
votes1
answer148
viewsProblem when showing Alertdialog
I have an error message when trying to show Alertdialog using Android Studio. protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
0
votes1
answer325
viewsUse Arraylist or Linkedlist
The interface List has several implementations, among them ArrayList and LinkedList. Usually I have been using only ArrayList, but would like to know in which scenarios it is recommended to use the…
-
0
votes2
answers709
viewsHow do I place the image next to the listview items?
I have the following code for listview: ListView listview = (ListView) findViewById(R.id.listview1); String[] dados = new String[] { "Produção Geral", "Perdas", "Contagem Por Máquina", "OEE",…
-
0
votes1
answer553
viewsJava - academic system
I have the program below in java. However, when I run option 1 or 2, it appears directly Name and Age. Should pull the name and only after I enter the name appear age. Someone knows me if any code…
-
0
votes0
answers32
viewsHow to use 2 databases using Room Sqlite?
Hello. Is it possible to use multiple DB using Sqlite Room? In my case I need to use 2 DB if it is possible to switch from DB1 to DB2 dynamically?
-
0
votes1
answer2990
viewsHow to import and configure a Maven project with Tomcat server in Intellij?
I have a simple project and would like to run this project in Intellij IDE, but I believe that unlike Eclipse, the IDE requires other settings in parallel to import. I would like to know how this…
-
0
votes1
answer113
viewsShow Complete string in modal
I’m using Java, JPA, Wildfly and Primefaces.I have a table that displays a text, but this text is being cut in the display by table size. I decided to create a boão that calls a modal to display the…
-
0
votes2
answers3264
viewsConvert the timestamp result to the formed Date and Time
I need to convert the timestamp result (eg 121242343543) to the format 2018-11-09T16:36:01. Controller.js: function salvar() { var dataBase = new Date().getTime(); // salva no banco var simulacao =…
-
0
votes2
answers51
viewsVariable declaration
I do not know what is the subject of this part of Java, but I did not understand it: Carro carro; I know that when declaring the variable we do: String carro; Why is there such a thing Carro? and…
-
0
votes2
answers177
viewsError using Radiobutton gettext() method
I created a very simple app to calculate an account with extra tip where I enter a value, select a Radio Button with a percentage and it generates the final value as a result. But every time I click…
-
0
votes1
answer2086
viewsNumber of repeats within an array
I’m trying to count how many times an element appears within an array. ` public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[] array = new int[4]; int a; for(int i =…
-
0
votes1
answer514
viewsWhat would be a service class in a Java MVC project?
You could tell me the difference between classes in the package "control" in a MVC project and service classes?
-
0
votes1
answer63
viewsArray search returning Default object
Good evening, my registration system there is an option (4 in the Menu) to search the data of the Object with the minor age between a range that I declare in the option (minimum age and maximum…
javaasked 5 years, 11 months ago Lindomar182 11 -
0
votes1
answer1220
viewsError:(1, 0) Plugin with id 'com.android.application' not found when doing project sync
apply plugin: 'com.android.application' android { compileSdkVersion 24 buildToolsVersion "24.0.0" defaultConfig { applicationId "app.teste" minSdkVersion 15 targetSdkVersion 24 versionCode 1…
-
0
votes0
answers226
viewsblock access with Spring
Beauty, in the configuration I made I’m not able to block access to the pages that are inside another folder inside my folder views. In case I’m trying to block access to everything inside the…
-
0
votes0
answers31
viewsProblems running Widfly 14
I am taking a course where I create a client register, but at the moment I will run the server Widfly 14, I have the following error: Can you help me please?…
-
0
votes1
answer481
viewsHow to keep the App always logged in with Firebase
How to get my App to log in after waxing? Ex: I logged in once and every time I start the application again it already starts logged in.
-
0
votes1
answer72
viewsError while performing android route : Androidhttpclient: Leak found
Guys I’m making the following mistake : 08-24 22:52:53.529 9872-9880/br.com.anjodarua E/AndroidHttpClient: Leak found java.lang.IllegalStateException: AndroidHttpClient created and never closed at…
-
0
votes2
answers65
viewsHow do I remove a band by its name?
I’m not getting the bands inside the arraylist. For this, I read the.txt file where the information(name,country,nrointegrantes) is stored. I made a split to access the name, but when I try to…
-
0
votes2
answers110
viewsError listing table directly from Sqlite
Guys: I’m creating a stock control application, I have a screen as follows: When I click on the "PRODUCT" button it was to go to that other screen: Only when I click on the button "PRODUCT" the…
-
0
votes1
answer133
viewsError: Runtimeexception when trying to mount test case
I’m trying to set up a simple test using espresso and the following errors appear: Code: import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import…
-
0
votes1
answer157
viewsFind comma in the parameters of a function using regex
I need to find the occurrence of a chain function call, but I need to include the case where there is more than one past parameter, such as: Tower.getType(i,j).initialPrice(f,g); So far I have only…