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
votes3
answers221
viewscep - fields disabled for user
I am with following problem: The user will complete the zip code and will click 'search zip'. A search will be made for the zip code, and the data will be placed in the fields: patio, neighborhood,…
-
1
votes1
answer588
viewsHow to run a task in the background
I am new to android programming and have been making an application for myself so far. In this app I want that when it goes into the background, that is, when you leave the application without…
-
1
votes0
answers31
viewsHow do I access a pdf file stored in R.raw on android SDK?
I think some information is missing to make the pdf file appear in my app. I used the following line of code within the Oncreate method: PDFView novo = (PDFView)findViewById(R.id.pdfView);…
-
1
votes1
answer911
viewsCreate java icon button?
I’m having trouble creating an icon button in java, I’ve looked at several tutorials, but I can’t make it work. Note: I am using eclipse, Windows 10. The folder that is the image is src where the…
-
1
votes1
answer103
viewsSpring MVC - Write Data to TXT
How could you get inside a Receive Data controller via Post (in Spring MVC) and write this data to a TXT? Later, in Model open this TXT and send to View. Would anyone have any example?…
-
1
votes0
answers48
viewsLimesurvey + Hibernate
I’m trying to develop an app that manages some surveys from the limeSurvey and for that purpose I am using Hibernate. So the whole problem is that the limeSurvey Give me the answers to each survey…
-
1
votes1
answer231
viewsStart Fragment class of another Fragment class
I have a class GuiaDaCidade. public class GuiaDaCidade extends Fragment { View rootView; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle…
-
1
votes2
answers243
viewsHow can I associate 3 authors to just one book?
package crud class Start { static main(args) { Autor autor = new Autor() autor.nome = "Aline Gonzaga" autor.email ='[email protected]' autor.cpf =' 78544378654' Livro livro = new Livro(autor)…
-
1
votes1
answer112
viewsHow to set the value of a spinner elegantly
Dear to an activity where we are making a change, I am setting the value of spinner(s) in a gross way for(int i = 0; i < clienteAdapter.getCount(); i++) { Cliente elemento = (Cliente)…
-
1
votes1
answer367
viewsDoubt about jTextArea.append (add the value of the area variable to Borderlayout) - Java
I have a problem with a line of code, this line that is underlined in the image, gives me an error that says that the coordinates X1, Y1, x2, Y2 have to be static, it turns out that this application…
-
1
votes0
answers415
viewsAdd seconds to a countdown - Android
I wish that when a button was clicked, 10 seconds would be added to my timer, but I couldn’t find a way to add value to Countdowntimer, here’s my code. private void contagemRegressiva(){ new…
-
1
votes1
answer65
viewsLock the enter key inside the <p:editor>
I’m using java, JPA and Primefaces with Wildfly. I have one from Primefaces that I want to block when the user presses the enter key there is no action. How should I proceed?
-
1
votes1
answer239
viewsWhy is null returned when accessing the managedBean resource?
I’m having problems accessing methods and attributes in a managedbean. I’m using JSF and the Glassfish server, I’ve already used an architecture similar to the one I’m using but on a Tomcat server.…
-
1
votes1
answer783
viewsError with GET HTTP Special characters
I’m having some trouble doing Gets HTTP. When the page text has some special character, the answer ends up deforming. Example: os participantes dever&atilde;o: when the original text was os…
-
1
votes1
answer72
viewsDebug sending email - java-mail-1.4.4
I have following code: private static boolean envioTest(final String descricao, final String msg, final String to)throws MessagingException{ final Properties props = new Properties();…
-
1
votes1
answer1248
viewsJPA(2.1) dependency on POM.xml file
I did a normal Javase project with JPA for the persistence part, and it worked, the project consists only of an entity that is persisted in the bank and nothing else. I used the following libraries:…
-
1
votes1
answer354
viewsHow to save java -version return to cmd
I have a problem saving to . txt the return of the command "java -version" executed in cmd. I am running as follows: java -version >> "%temp%/resultado.txt" It creates the file but does not…
-
1
votes2
answers4333
viewsHow to resolve java.lang.nullpointerexception in sqlite application?
I am having problem with this exception. I have seen some tutorials here, but none of them can solve my problem. Even the answers to similar questions could not satisfy my need. I’m making a desktop…
-
1
votes1
answer157
viewsJframe opening repeatedly twice
I’m new to desktop programming, well, I’m making a program in java using swing and sqlite database, I’ve already made some things work, but after login the jframe that should open a single view…
-
1
votes1
answer165
viewsFilter passes before login Servlet
Good evening guys, I have a question, I don’t even know if I need to post the code to solve. The filter is being called before the login Servlet, that is, with that the user is never logged in. How…
-
1
votes1
answer602
viewsLog4j 2.x with multiple files depending on the level
I am a log4j beginner. I want to create a different file for each level of log (warn, error and etc). I have the following xml configuration file: <?xml version="1.0" encoding="UTF-8"?>…
-
1
votes1
answer213
viewsProgrammatically insert dividing line
How can I program a dividing line using java? The XML code is: <View android:layout_width="match_parent" android:layout_height="1dp" android:background="#ddd" />…
-
1
votes0
answers60
viewsError while using "this"
I’m trying to implement a code with direct dial using Action_call in android studio but this giving error in this and can not solve , someone could help me?…
-
1
votes0
answers157
viewsRecord attendance of students in the Database
I have a school management system, where, I aim to add an option for teachers to add the student’s frequency. I’m thinking of creating a transaction, where, each teacher accesses, the page that will…
-
1
votes2
answers305
viewsError in web system authentication
I’m learning together with a tutorial to develop a petshop system and I’m getting the following hibernate error: Hibernate: selectcliente0_.idClient as idClient2_2_, cliente0_.email as email3_2_,…
-
1
votes0
answers222
viewsBluetooth service to communicate Java Desktop and Android application
I’m doing tcc, the project is to create a java desktop application and make it communicate with an android application. As this communication will be in a room for example, always in the same…
-
1
votes0
answers1131
viewsConfiguring JAVA Environment Variables
Follow the setting of my environment variables: PATH - C:\WINDOWS\SYSTEM32;C:\Program Files\Java\jdk1.8.0_121\bin JAVA_HOME - C:\Program Files\Java\jdk1.8.0_121 JRE_HOME - C:\Program…
-
1
votes0
answers330
viewsWhat are anonymous objects in Java?
Can someone give me examples of how to use anonymous objects in java?
-
1
votes1
answer2809
viewsHow do I alphabetize my list?
I have a ListView and I’d like to alphabetize the names of the clients. I urge you to be as specific as possible because I don’t have much experience. import static android.R.id.list; import…
-
1
votes2
answers1412
viewsSelenium Webdriver
I am learning to program test automation using Selenium Webdriver with Java, but when I run the same test in Firefox and Internet Explorer the following message appears: Exception in thread "main"…
-
1
votes1
answer41
viewsPrint the previous 30
I have to print the 30 numbers previous to the number chosen by the user. while(valor > (30 - valor)){ System.out.println(valor); --valor; } I did so, but he does not print the previous 30,…
-
1
votes2
answers327
viewsJPQL hibernate for multiple Ikes
I’m using Hibernate in my project and I’m having doubts about using multiple dynamic Ikes in my research. I have a simple field on the page where the client can enter a user’s name, but I need it to…
-
1
votes0
answers239
viewsWidth Search and Depth Search
I am studying for the Programming Marathon and I need examples of searching in width/ searching in graph depth
-
1
votes1
answer286
viewsAccents ~ not working in Javafx
Hello, I received software that uses Javafx, and it was in the development stage to be finalized. I’m testing it and I realized that Portuguese accents, like, ~ and `, are not recognized in…
-
1
votes1
answer1007
viewsEclipse Installation
Could someone share some updated Eclipse setup and configuration manual, and in this manual have the steps for setting up the environment variables so I can compile and run the projects?
-
1
votes1
answer761
viewsError saving related entities - Unsave Transient instance
A subsidiary owns a product - relationship @OneToOne - and one product has several historical. Method of registering implemented: public class CadastroProdutoService implements Serializable {…
-
1
votes1
answer403
viewsDoubt about changing data in java arrays
I have an array of the Person class called vector. I already populated the vector with instances of named persons of p1. My question is how to change the value of p1 when you’re inside the array:…
-
1
votes0
answers23
viewsHow do you make Jboss listen to IDE modifications other than the one you are?
The problem is, I have jboss in eclipse, but I don’t like it to work with HTML, CSS and JS I prefer to use Visual Code! When climbing the application I make the modification using Visual Code but…
-
1
votes1
answer188
viewsIncompatibility of type blob and byte sqlite
I’m making an application to save the image in sqlite. But you are acknowledging the following error in my dao class: incompatible types byte cannnot be converted to byte. My Classes: import…
-
1
votes0
answers109
viewsDuplicate register
I’m registering for Refeicao and Aliementorefeicao. To register the items of the Foodstuff you must register the Meal first. The problem is the data are being recorded, but as I want to register…
-
1
votes1
answer92
viewsIs it possible to change the function of the physical button, even with the app in the background?
Would you like to change the function of a physical button, for example the volume, by clicking the button, bottom or top, if it is possible to perform a function other than changing the volume of…
-
1
votes0
answers128
viewsIs it possible to include OCR in java android ? Is there any OCR library in JAVA ?
I already researched something about OCR on the internet and found the solution from GOOGLE, but it is very expensive.
-
1
votes1
answer762
viewsShow typed text in a text field after clicking button
The code below I got from the Internet is working for me. In the main, it executes a form with the name to type and the button ok. I wanted to run, no main, shortly after the new MeuPrograma(); one…
-
1
votes0
answers69
viewsError when converting java project with Jersey to Maven
I created a project with angular and WS REST using Jersey. It was working normal until I went to convert the project pro Maven. While trying to move up the project, I’m having the following…
-
1
votes0
answers116
viewspass several parameters to the ireport
In my Java program I select a list of values and wanted to pass this list to iReport as parameter. This parameter would be used in the SQL query: SELECT ... FROM ... WHERE ... IN($P{list}) when I…
-
1
votes1
answer475
viewsReplicate message to all chat customers
I need to replicate a client’s message to everyone who’s connected except the client you sent. Below is the classes I have so far. How could I replicate these messages? public class Servidor {…
-
1
votes0
answers45
viewsDesign mode error in Xamarin
I have this problem in my project using Xamarin: I searched the Soen and found that, but it didn’t. What is missing is to uninstall everything and I have no guarantee that it will work. Waiting for…
-
1
votes0
answers16
viewsDifferentiate itensv
I have two classes being registered, the Meals and Food class. They perform several registrations at the same time, but I’m not able to differentiate the items for each meal. I select the meal and…
javaasked 8 years, 10 months ago Leticia Noni 21 -
1
votes1
answer673
viewsHow to Integrate Frontend with Java?
I’m a beginner in frontend. I’m making a system using html, bootstrap, javascript and jquery. I’ll have to make the integration with the java. I would like some guidance because I don’t know where…
-
1
votes0
answers486
viewsApostille Caelum fj21 mysql driver error
Good afternoon, everyone, Starting I am studying the Java WEB workbook from Caelum but the following error is appearing. I already imported the Mysql driver, I switched between the commented line…