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
answer912
viewsComparison of an image with others (analyze whether the chosen image is the same as the others already predefined or not)
I’m trying to make a code in Java that compares an input image with other n images already defined in the code. I developed, with (quite) help, a similar code, which compared two images only, the…
-
0
votes1
answer77
viewsException error in thread "main" in my Array
Guys, help me, I can’t find the error in my code. I know this error refers to not having the position in the array to store but I don’t know where to fix it. package…
-
0
votes0
answers42
viewsLogica Error(I think)
Good evening programmers, I’m having a problem with my code and I don’t understand where it’s wrong. I created the following jFrame and the buttons "<" and ">" should, after the entries are…
javaasked 7 years, 6 months ago Vitor Couto 1 -
0
votes2
answers1259
viewsSort Collection
I have a class called Object and within it possesses a Collection of Events, so to sum up: public class Objeto{ private Collection<Evento> eventos; } In the Event class, I have my attributes…
-
0
votes0
answers67
viewsSqlite only accesses the bank on a device
I created an application on Android that accesses the Sqlite database, the first application I created works normally! The application that works is version 7.1 of Android, but when I try to run the…
-
0
votes0
answers91
viewsAdmob Banner - Android
I’m trying to put a banner on my app, actually I got it. But when I run the virtual machine, it sits underneath the buttons, the machine is a Nexus 5. My activity_main code is this. <?xml…
-
0
votes1
answer158
viewsHow to Insert List with JPA
Good afternoon! I am making a web service that receives a Json from the application, disembowels and inserts into the database. I can disembowel normally, the problem occurs at the time of entering…
-
0
votes2
answers150
viewsAfter @Joincolumn JPA does not find Entity attribute
I have two entities that are directly related to @Entity State and @Entity City And my intention was to rename the foreign key present in the customer identity, for example, from 'city.stade_state'…
-
0
votes1
answer65
viewsCalculating Random Password using Arraylist and Resultset in Java
Good morning, I have a question, I need to calculate a new password for each Patient when going through this method: ps = getConexao().prepareStatement(SQL_VERIFICAR_PROTOCOLOS_PENDENTES);…
-
0
votes1
answer88
viewsWhy are you not entering the if?
I want to perform an operation if the 2° position of a string is higher, but it is not entering the if, and I think the if is not correct. Example: digital user 4A6 then in this string the 2°…
-
0
votes1
answer53
viewsError when placing list on Android
I’m starting now with the development for Android. I tried to put together a list but it’s not working. Preview only appears Item 1, Subitem 1. Follow the . Java public class Lista extends…
-
0
votes1
answer82
viewsI’m not getting a postBack on my project
I’m trying to do a postBack on my project only I’m not getting it. When I submit the form it continues to select without precision. That is, it was in the same way public class FacesUtil { /** *…
-
0
votes1
answer164
viewsHow to create Components dynamically, being created in relation to other existing Components?
In an android studio project, when clicking on one of the 2 existing Textview on Activity (01 and 101) a Textview displays a corresponding answer to the choice. I would like to know how to make a…
-
0
votes2
answers610
viewsHow to get name of objects contained in JSON with Java?
Needed to extract the name of objects contained in a JSON file, for example, show that the JSON file below has the batteryCharge objects, luminousFlux, id, temperature. But do this search without…
-
0
votes1
answer44
viewsI do 2 dates check plus is persisting
I have a form, and before saving I want you to make a check that in case would be two dates. Only when a check is made it launches a Message until then OK. More ends up appearing another referent…
-
0
votes1
answer64
viewsWhy is it taking so long to complete Data?
I have the following problem, when searching the data in the database and filling my object to manipulate on the screen, it is taking too long and leaking memory, I tried to optimize but I could…
-
0
votes2
answers257
viewsScroll of the slow, heavy Gridview,
I’m trying to create an app that is a kind of gallery. Search the photos on mobile and shows the user. The app is already working, but it turns out that the gridview scroll is slow. I don’t know…
-
0
votes2
answers1577
viewsProblem with special characters
i have an application that downloads a csv file from an ftp server and within that file contains product information and the app must insert it into a database, but the special characters are coming…
-
0
votes1
answer815
viewsLoad data from a method list to Servlet
Good afternoon people! I have this method in Servlet that returns a list of values. How do I load the values it has, with jquery?…
-
0
votes1
answer953
viewsWhy isn’t the menu showing?
I’m taking an online course and the menu part is not working in my Android Studio. First, I deleted the Contents who came, left only what is Activity in the Layout. About the code: The App starts in…
-
0
votes0
answers57
viewsobjects sharing the same copy of a variable
The goal is to put into practice the contained concepts that I am learning in MALA GUPTA, 2015. So the way I’ve found to contribute is to ask the community to actually implement the concepts. So who…
-
0
votes1
answer672
viewsproblem using Primeface modal
I’m using a modal within the Only when I close, it gets locked the components, I think I must have done something wrong. Follow my code. <ui:composition…
-
0
votes0
answers45
viewsDifficulties with Logic A
Well the scenario is the following I am trying to develop an electronic point through my application but I locked in the logic of authentication of the dates and hours of work following in the logic…
-
0
votes1
answer921
viewsCalculator problem in android studio
I’m a beginner and I’m developing a simple calculator in android studio, but it only shows the result of two values, ex: 1+1=2. I would like to do several operations at the same time, e.g. 1+2*3/4…
-
0
votes0
answers54
viewsSqlite Leak without having any class using Sqlite
Good evening, everyone, I’m building an Android app and the last thing I need is to build the local bank. I built it but I realized that errors of memory appeared Eak, I thought I had fixed but the…
-
0
votes0
answers40
viewsForm via PUT method is not sending the data to a restEasy service
I am sending a form via Ajax, my front is done in Angularjs. I capture the form information and send it to a service that is in Java Restreasy. But it arrives Nullo! Someone could help me? In my…
-
0
votes1
answer104
viewsCorrect way to update an object property
I created an update method, however I am having to create a variable to update my position property, which although it is working, I think this would not be the correct way to treat an object. I…
-
0
votes1
answer1469
viewsProblem while doing an update
Well I’m having difficulty to perform an update on my database it is presenting the following Exception. ERROR [org.springframework.security.web.Authentication.Usernamepasswordauthenticationfilter]…
-
0
votes1
answer474
viewsJAVA - Google maps api recover line distance
I am developing an app for android that uses the google maps API, everything is right with the app the problem is in the webservice that deals with the information collected by the app, at a certain…
-
0
votes1
answer1700
viewsError "Cannot make Static Reference to the non-static faithful
I’m doing a class exercise Carro and subclasses Familiar Citadino and Jipe... Only by making a class Testabuzinar1 which instantiates each of the subclasses and then calls the horn method (which is…
-
0
votes1
answer200
viewsSpring returning NULL in only one of the form fields
I am learning Java and am having a problem with a form using Spring. I even found a similar problem here on the forum but a little different from mine. It is a basic login page, containing only two…
-
0
votes0
answers69
viewsAndroid - Variable in Runnable
I’m developing a class for UDP communication with Android + an ESP82666, I just have a problem in it. My Runnable "Sender" can not get the List toSend updated, for it toSend is always empty. What…
-
0
votes0
answers756
viewsSelect item in Jcombobox and return associated value in Jtextfield in JPA
I try several times in a Swing form to make sure that when selecting the option in Jcombobox the value of the item in the column of the same row appears in Jtextfield. Once I managed to do this…
-
0
votes1
answer43
viewsWhat’s the highest number. Can’t figure out what’s missing?
I’m doing some loop-for exercises to apply what I’ve learned. In this classic exercise request 10 numbers for the user and show at the end which is the largest. I did so: import java.util.Scanner;…
javaasked 7 years, 6 months ago Salatiel Aizza 1 -
0
votes1
answer507
viewsProblems reading a PDF with TESS4J image
I recently started to develop a small executable jar that converts PDF to text files and it will work in Windows environment. Using TESS4J 3.3.1, I developed the following process: A) The user can…
-
0
votes1
answer79
viewsDate and Time Data Type Elements
Personal I would like to ask a question, we should treat differently fields that have as kind of data time and date I say in relation to the view, Why I have a problem I need to plot some date and…
-
0
votes0
answers667
viewsProblems to pass two parameters in the url using Thymeleaf
I have next step on my controller: @RequestMapping(value = "/", method = RequestMethod.GET) public ModelAndView home(ModelMap model) { Page<Postagem> page = postagemService.findByPagination(0,…
-
0
votes0
answers153
viewsJava programming with threads
Staff need help for an activity: Consider three vectors of numbers. Write a program to print out the largest Twin Primes numbers in each vector. Which are the largest twin prime numbers considering…
-
0
votes0
answers951
viewsUse . POST or . DELETE method for request to delete data
I was using . delete but suddenly the method is not being recognized from the error in the console. 2017-04-12 09:51:34.022 WARN 5836 --- [nio-8080-exec-9] o.s.web.servlet.Pagenotfound: Request…
-
0
votes1
answer356
viewsError with Mysql insertion with JDBC
I’m running this code: /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the…
-
0
votes0
answers49
viewsHow to optimize a power loop of 2 n and (2 n)+1 in java?
Good, I’m doing a job where I have to do tests in Stacks, and the tests have to be done when I push and pop of powers of 2 and powers of 2 plus one (1,2,3,4,5,8,9,16,17, etc...) I got some code…
-
0
votes1
answer58
viewsQuery is repeating results - Sqlite
I’m making a query in my bd Sqlite, but is returning me some repeated results can not find the error. cursor = db.Select(DataBaseHandler.TABLE_OS + " LEFT JOIN " + DataBaseHandler.TABLE_SITUACAO + "…
-
0
votes1
answer595
views@Onetomany Bidirectional
Good afternoon, you guys I am developing a financial web application and am having problems in making the relationship between Lancamento and ItemLancamento. I will post what I have done so far,…
-
0
votes2
answers810
viewsSelect Count Java
I want to select with the Count function and bring all the records of a table, but when presenting the quantity in the textfield, it displays a different result. I’ll put the code in for you to…
-
0
votes1
answer26
viewsHow do I transfer data from the inherited array(Objects) to the array(reserves)?
package pkg2017ppfp09; import ObjectManagement.ContainerOfObjects; /** * * @author pf */ public class GestorDeReservas extends ContainerOfObjects{ private final int MAX_RESERVAS = 10; private final…
-
0
votes1
answer80
viewsJSF change information in XHTML
Good night. I have a java/jsf application I’m having a hard time showing information in XHTML, Well I have a SelectOneMenu to save information in the bank: <p:selectOneMenu id="PermissaoAcesso"…
-
0
votes0
answers174
viewsUpdate Datatable line after Celledit primefaces event!
I’m updating a datatable cell, it has 3 columns, description, current price and old price. I can normally call the bean to make the change and save to the bd. However, I can’t update the record in…
-
0
votes2
answers724
viewsRegular expression to deny anything other than social reason
I’m trying to create a regular expression to remove everything that is not part of the social reason in a string, but I’m having a hard time not removing the symbols that are in the middle of it.…
-
0
votes0
answers60
viewsStop a java processing
I have a processing with a class calling another. Example: I have the registro0100. In it I call the ED022, ED021, etc..... In this ED022, I have some validations, example: boolean achou = false; if…
-
0
votes1
answer733
viewsHow to use iReport with Oracle?
I’m having trouble adding the oracle driver in the iReport Designer, I tried to follow some tutorials, but I was not successful. So my question is, how do I add and perform the necessary settings…