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
answer423
viewsImplementing Regular expression in Java
I need to make a program that reads a file and can count how many classes and methods there are. The reading and separation part by line I have done, I need to identify class and method. I am…
-
1
votes1
answer426
viewsValue '0000-00-00' can not be represented as java.sql.Date
I need to take a table called history the last three months and a year before to register in the product table. The code is as follows: for (int i = prod.getHistoricos().size(); i >= 0; i--) { if…
-
1
votes1
answer136
viewsCapture action of certain buttons in a Jframe
I created a JFrame that by clicking the keyboard buttons: up, down, left and right, there should be a certain action (a Joption in the case). That’s why I’m wearing one KeyListener, but…
-
1
votes2
answers580
viewsRedirecting JSF pages
I’m looking to redirect the main page to login page so I set the faces-config.xml together with the main page below my code for you to see Code faces-config.xml <?xml version='1.0'…
-
1
votes2
answers1841
viewsHow to send java post information to a php page?
I’m facing a problem that I don’t know how to solve right now. To put it bluntly, I’m having trouble sending data in json to a php page through a java application. Basically, I have a php page that…
-
1
votes2
answers347
viewsError in DELETE method, to delete a data from a table
I am trying to make a method to delete an entry from a table with Java and jsp, but is giving error 405. I will attach the codes. Productodao.java.: public void remove(Produto produto) {…
-
1
votes1
answer298
viewsHibernate and object list
I’m developing my first java application, desktop application with Netbeans and Hibernate. I have the tables membros and estadocivil. The member has a marital status. I mapped the classes using…
-
1
votes1
answer406
viewsLong running period web service
I am creating a webservice that makes consult in a DW these queries for having functions of aggregations and everything else take a little more time than normal (something around 2 - 5 minutes),…
-
1
votes2
answers415
viewsAccess Sqlite database in another Activity
I’m starting in java android, I’m quite layy yet, I’m picking up the concept of POO gradually. My problem is this, I have a Criabanco class and another Bancocontroller where I have some methods to…
-
1
votes2
answers64
viewsI don’t understand why the app closes
package com.pedrogouveia.teste1; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import…
-
1
votes1
answer1142
viewsHow to view images in Listview from Firebase?
Well I am receiving numerous information from firebase, and displaying them, however I would like to receive also images, without last storege, I already saved some urls in the database and when I…
-
1
votes0
answers57
viewsDoubt with JSP - Message
I am in need of help, to display a message through fmt:message. The situation is as follows. I have a form that is submitted via $.post. In the controller that receives this request, I do a…
-
1
votes1
answer151
viewsHelp with JPQL query
I am trying to return a group query together with the product entity by returning all the data from the product table and the sum of the quantity. I get a mistake which is this: Exception in thread…
-
1
votes1
answer481
viewsCompare dates and validate only the same year
In my component p:calendar there are two date ranges dtInicial and dtFinal in the Managed bean I need to compare only the years and validate. If it is the same year, display the "ok" message.…
-
1
votes2
answers58
viewsHow do I make an operation run moments after I have clicked a button?
I created a simple android app that starts a service soon when I click a button I put, just click the button it starts the service immediately. What I want now is that clicking the service button…
-
1
votes0
answers27
viewsNOT FOUND in the webservice paths
I have a big problem with my webservice. I created CRUD and it worked normally, but new paths with path are not working, I don’t know if when I exported the project when crud was running .war. I…
-
1
votes3
answers221
viewsError in "switch case"
I have a mistake in one of cases of switch, the mistake is this: I’m doing a CRUD from a library, so when you see the code, maybe you think something’s weird: I made some switch with only 1 option,…
-
1
votes1
answer194
viewsNull in Primefaces Component Uploadfile
I am having trouble trying to recover that file,file, in my bean. .xhtml <h:form id="form" enctype="multipart/form-data"> <p:fileUpload value="#{bean.file}" skinSimple="true" mode="simple"…
-
1
votes0
answers46
viewshow to use query with more than one field (Moldel .vo) in a datamodel
I have the following query and I am willing to put this list with products and the sum in a datamodel list. public List<Filtro> listarProdutosDoGerenteRegional() { try { return…
-
1
votes2
answers259
viewsHow to take Sqlite Database Date on Android and format in dd-mm-yyyy using viewHolder?
public class ContatoArrayAdapter extends ArrayAdapter<Contato> { private int resource = 0; private LayoutInflater inflater; private Context context; public ContatoArrayAdapter(Context context,…
-
1
votes1
answer249
viewsWhat is the best location to provide a property file?
Has a Java project on Spring Boot which connects to the database. Consequently I have an application.yml properties file with the database connection settings. In this file of properties the…
-
1
votes1
answer300
viewsSpinner does not display the selected value
I retrieve data from Firebase and when I select one in the spinner, it does not identify the selected one. This is the Fragment spinner = (Spinner) view.findViewById(R.id.spn_l_estados); try {…
-
1
votes0
answers79
viewsRun Schedule only in production environment
I have a procedure that runs every beginning of month to reset password of inactive users. This procedure changes the user’s password and sends an email notifying the new password. However, I have…
-
1
votes1
answer1113
viewsProblem with switch menu case and while
My goal is that after I run one of the menu options and say I don’t want to continue on it, I can insert another option (or the same if I want to go back). My code runs the first option I type but…
-
1
votes0
answers83
viewsGroup at Ireport (Jasperstudio)
Good afternoon, To create a report I do two searches, one in each separate table. After, I create a list only with the data returned from these two. Example: List<Venda> lista = new…
-
1
votes1
answer159
viewsUpdate warn change
You can tell if a value has been changed in a direct table in the application? Like I gave a UPDATE tabela SET valor = 1 WHERE id = 2; And in the application appear the message: O Valor foi alterado…
-
1
votes2
answers237
viewsRadiogroup in Listview does not maintain selection after scroll
I have a Listview with some information and within it I have a Radiogroup, but when I scroll the screen all my checkbox are unchecked because the listview is creating this checkbox again. I need my…
-
1
votes1
answer125
viewsquery model.vo a solution with jpql and subqueryes
I have the following query in Mysql wanting to move to JPQL and I am doubtful in syntax: SELECT a2.produto , a2.descricao, a2.quantidade_recente, Soma from (SELECT p.codigoProduto,…
-
1
votes1
answer190
viewsJava with Mysql (JDBC) - Type YEAR
I have a question on how to record a YEAR type in the MYSQL database using a Java application from a Textfield, I have tried using Date type, but I can’t take only the year to record in the YEAR…
-
1
votes2
answers530
viewsHow to make a direct calculation in the database
I would like to calculate the salary of a teacher based on the hourly load of discipline that he teaches, I created a Java algorithm for this, but however I can’t pass it to SQL Algorithm in Java…
-
1
votes1
answer494
viewsSpring error starting server
I imported a Maven project that worked perfectly before, but now I’m with it giving error. Every time I try to fix this error, I keep changing the versions of Java, deleting and importing again and…
-
1
votes1
answer1412
views(JAVA) Help in Sorting Exercise (Selection Sort and Insertion)
/*EXERCISE: Write a method that puts in ascending order a disordered sequence of n integer. (a) Using sorting by selection (b) Using sorting by insertion*/ I tried to solve the exercise, but I’m…
-
1
votes0
answers582
viewsCommunication between Python and Java
I am trying to create a client server application where the server will be written in python and the client in Java. The problem is that when you send a message from Java to Python the python server…
-
1
votes2
answers245
viewsCannot Resolve Method isChecked()
I am trying to use the isChecked() method but is giving the message "Cannot Resolve Method Ischeked(). Can anyone help me? @Override public View getView(int position, View convertView, ViewGroup…
-
1
votes2
answers2437
viewsInvert Simple List
EXERCISE: Write a method that inverts a linked list: Entree: 10, 99, 101, 666 Expected Result: 666, 101, 99, 10 I thought to follow the following logic: It would arrive until the last element (666)…
-
1
votes3
answers165
viewsNumbers smaller than the average
I need to average 20 numbers and present all the numbers below average. package pag1; import java.util.Arrays; import java.util.Scanner; public class ex2 { public static void main (String[] args){…
-
1
votes1
answer64
viewsSwitching screens with the same XML file
I am developing an educational application (with various exercises about java and explanations) for Android, but I have a question: the application becomes very heavy if I create a Activity (with an…
-
1
votes0
answers429
viewsMenu Toggleable Primefaces
I have the following code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"…
-
1
votes0
answers660
views -
1
votes1
answer992
viewsGrab a network java file
I managed to open a file and put it on a Jlabel on the machine where I am developing. But when I put the application on the network the machine that is on the network, it does not locate the file.…
-
1
votes0
answers21
viewsCamera Intent returning error
Old phone : Samsung S4 ANDROID - 4.2.2 -- New phone : MOTO G4 - 6.0.1 My application was working until yesterday, I switched to a new phone today ,I do not know if you have something to see ,is…
-
1
votes0
answers577
viewsQuery nfe in Java
I want to make a form with the access key field and the code captcha to be filled in. This data will soon be sent to the NFE portal and will return the NFE information to me. The captcha I’ve…
-
1
votes0
answers40
viewsList 5 objects from a List
I’m putting together a panel that should show 5 products, for example, on a page index, but I can only load all the objects that are saved in the comic book, and I can’t think of a way to do that,…
-
1
votes2
answers2038
viewsWork with JSON for request and Java Sponse
I need to consume a WS with Rest that is already almost complete, only 2 things to finish: - mount the request JSON and manipulate the Response JSON. Here’s an example of the template I need to…
-
1
votes1
answer237
viewsHow to pass a local variable to an anonymous class?
I need to pass the control variable of a for, as a parameter for a method. The problem, is that I am trying to do this according to the JRadioButton which was selected, I am creating them according…
javaasked 7 years, 3 months ago Gustavo Santos 811 -
1
votes1
answer287
viewsItem in selected combobox, display data in jTable
Before asking this question, I searched the forum and in several places but could not solve... I have a combobox that already carries the names of customers, then I wanted to select the customer,…
-
1
votes2
answers46
viewsError in Sqlite class
What am I doing wrong in this class of Sqlite ? I’m getting this error: java.lang.RuntimeException: Unable to start activity…
-
1
votes0
answers61
viewsBuy App Functionality (In Billing)
I would like to make my app have the option to buy functionality. Like I made two apps, one paid (full) and one free (with advertisement). I would like the person clicking to buy to remove the…
-
1
votes1
answer523
viewsHow to instantiate a vector
I’m doing a program (college work), and I’m having trouble instantiating a vector. Also he’s presenting some errors that I’m not able to solve - one of them is in the loop while, at the closing of…
-
1
votes0
answers316
viewsError sending data to Firebase
Good afternoon, I am developing an application and I am having problems sending the data to Firebase... I created a Registration screen where you have the email field, password and name. I imported…