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
answer136
viewsSonar + Maven + Jenkins integration
Good morning, everyone, I am setting up an integration server using Jenkins + Maven + Sonar Quebe, but I have the following scenario: 1 - If junit tests fail, Maven stops deploying the application.…
-
1
votes1
answer1500
viewsReturn a list of even numbers in a list and odd numbers in another list?
Good night!! I need to create a method that receives a list of integers and returns a list from that list, containing in one of the lists the even numbers and in another list the numbers odd. So far…
javaasked 5 years, 6 months ago Julio Vieira 39 -
1
votes3
answers109
viewsI made a Splashscreen it carries and it does not go to the Activity prixima what should I do?
What I must do ? intro.java public class intro extends AppCompatActivity { protected static final int TIMER_RUNTIME =5000; protected boolean mbActive; protected ProgressBar mProgressBar; @Override…
-
1
votes0
answers63
viewsError while listing data in Primefaces Dialog
By clicking on comandButonn this being loaded the last video from the list in the dialog, however in datatable works properly when displayed by the component media. I want to make it easy for the…
-
1
votes0
answers238
viewsPrimefaces - ColumnToggler Size
I have a datatable with a columnToggler, however I would like to remove the fields without increasing the size of the first field. I’m Using Primefaces 6.0. <p:dataTable id="cars" var="car"…
-
1
votes1
answer63
viewsError Opening a Maven Project
Every time I try to import some Maven/Spring project gives me this error, some error in build 3.0.1. Does anyone know what might be? I am using a Macbook Pro (version 10.13.6 (17G65)) macOS High…
-
1
votes2
answers169
viewsHow to change attributes of all project Textviews at runtime?
I am implementing a visual settings section of a project and one of the settings should allow the user to change the fontFamily of all texts, there is also the option to leave all texts uppercase or…
-
1
votes1
answer68
viewsWhat happens if I forget a bugger
I have a question, when I do debugging sometimes I forget to take the breakpoint, but what happens if I forget and my project goes into production? I think as are breakpoints of ide nothing will…
-
1
votes1
answer180
viewsHelp with post login menu in JSF in Javaweb
Talk to the guys, all right? I’m making a project manager in Javaweb with Hibernate, TDD, MVC, JSF, Primefaces and more I don’t remember kk, Next, when I log in to my project I make the menu appear…
-
1
votes1
answer149
viewsUpdate on sqlite does not update data
Hello, someone could help me ,the update is not updating the data! Follow the button that calls the method: @Override public void onClick(View v) { Receita rec = new Receita(); String dosradio =…
-
1
votes3
answers412
viewsLack of Java memory even though the computer has available memories
The Java Virtual Machine "JVM" can run out of memory even if the physical machine has available memory?
-
1
votes1
answer236
viewsHow to rename a file with lib.io’s File class?
I’m having trouble understanding what the method really is .renameTo(); does. Follow the example: File arquivo = new File("caminho/nomeAtual.txt"); System.out.println(arquivo.getName());…
javaasked 5 years, 6 months ago Lucas Marinzeck 318 -
1
votes2
answers2506
viewsChange only hours, minutes, seconds of a Date object
I need to change only the hours of an object of the type Date, preserving the day, the month and the year. I tried with the setMinutes(), setSeconds(), setHours(), but appears "is deprecated".…
-
1
votes1
answer77
viewsHow to return to Activity and execute a method?
have the Activity Profile.class and it displays my photos, when clicking on it, opens a fragmentDialog displaying the photo in slideshow... but when deleting the photo, need q back to my profile and…
-
1
votes1
answer76
viewsjava.lang.Nullpointerexception in method
package view; import br.com.genius.dal.ModuloConexao; import java.sql.*; import java.util.ArrayList; import javax.swing.JOptionPane; public class Chamada_ListaCompra extends…
-
1
votes2
answers225
viewsInputtext returns null
I got a problem I don’t know what else to do. My idea was to have a Checkbox that when marking would show a field and when unchecking would hide this field, for that I used rendered and ajax,…
-
1
votes1
answer357
viewsDoubt in Send SMS + GPS coordinates
I’m trying to develop a app, where I need to get GPS coordinates from the location of the device to send them by SMS. What happens is that I intend that with a click on a button the logic make the…
-
1
votes1
answer247
viewsHow to Enable Java EE in Apache Netbeans IDE 10
I downloaded the final version of Apache Netbeans 10.0 on official website, however Java EE is not enabled, I go to the IDE plugin itself, but the download option does not appear.…
-
1
votes0
answers140
viewsEdit datatable in Javaweb Dialog box - JSF
I need to edit a datatable line when I open the dialog box, but it’s not working the way I’m doing, I did a test on the console, and the object is null when I send the edit, it’s like I don’t load.…
-
1
votes0
answers266
viewsjava.lang.Illegalstateexception: Cannot create a Session after the Response has been Committed
Good morning guys, I am with a strange problem in my application only after Gero War and send to Integrator, the application does not even open the Login screen, is returned this error: INFO:…
-
1
votes0
answers201
viewsOpen File in Modal Dialog
I am recovering a file given a path and would like to display the answer in a Modal. This is a snippet of HTML that calls Servlet (MSD) by passing the file path as parameter: <a class="btn-doc-sm…
-
1
votes1
answer512
viewsParametric passage from one fragment to another
I don’t know how to work with two fragments, I looked for some things here but I didn’t know how to look right. Of Activity for another I use the Bundle and it works, but I don’t know how to use it…
-
1
votes1
answer50
viewsIs it possible to handle exceptions without catch?
I’m learning about treating exceptions and I’ve come to wonder if there’s any possibility of using the treatment without the command catch.
javaasked 5 years, 5 months ago Lucas Soares 13 -
1
votes1
answer67
viewsJava: generating the design of a non-deterministic finite automaton (NFA)
I am making a program that receives a text file with parameters of a nondeterministic automaton, from it rules are created for this automaton, with ifs where each state should go. However in the end…
-
1
votes1
answer160
viewsHtmlunit / Webclient / Wildfly10 error
I’m trying to use the htmlunit but it’s happening: *** Environment/Server: WildFly10 When executing the following command: WebClient webClient = new WebClient(BrowserVersion.FIREFOX_45); The mistake…
-
1
votes1
answer366
viewsPass parameter in Bundle
My application uses message internationalization, etc. I would like to know how to pass parameters when passing a key that will fetch a value in the file .properties. Ex: My crud screens will always…
-
1
votes1
answer384
viewsHow to order double chained list without affecting the original list?
Hello! So far, I have been able to implement all the methods on the list, including the sort method. However, the problem is that when ordering, even creating a new list and making it receive the…
-
1
votes1
answer770
viewsCapture webcam image and save every 1 second?
I’m doing a project where the standard webcam takes photos every 1 second using opencv. In my code, at the click of the capture button you select the folder where you want and it captures a photo. I…
-
1
votes0
answers515
viewsDynamic menu with JSF and Primefaces when it becomes responsive does not work
I have a dynamic menu on my site, which is brought through categories previously registered in the database. Within each category, it has a list of subcategories. When I click on a subcategory, it…
-
1
votes0
answers23
viewsListing dates with primefaces
I’m listing dates using convertDateTime, the problem is this way it always presents the day before what is being read database. Without the convertDateTime it presented the correct date.…
-
1
votes1
answer68
viewshow to access the webview inside the onBackPressed method on android
Hello, I’m trying to implement the back to the home of my applicator, my app is all built inside the webview, I need to call the javascript Function to return home, because when I click on the back…
-
1
votes2
answers369
viewsSave App Settings
There is something I can do to save my application settings without creating a database, so when the application is closed and then reopened it will continue with the settings that were previously…
-
1
votes0
answers399
viewsHow to recover/retrieve the value of the "unicodePwd" attribute in Active Directory via a java application
I read several articles here on Stackoverflow on how to get the value of the attribute "unicodePwd" in AD (Active Directory), but none of these articles helped me in this situation. Well, why do I…
-
1
votes1
answer31
viewsDifferent web applications use the same connection pool
Hello! I have two Webs applications that are connected to a single database in the bank, how do I make them enjoy the same connection pool? I create the c3p0 variables in the persistence.xml of…
-
1
votes1
answer60
viewsReturn focus to a Jformatedtextfield after clicking button
I need to click on Wipe Button on the Login screen the CPF and Password the cursor goes back to the CPF field. JFormattedTextField ftUsuario = new JFormattedTextField(); try { MaskFormatter…
-
1
votes1
answer91
viewsInt field as string
I’m working on a code for a college job, but I’m having problems, although the "home" is set to INT, netbeans continues to present: "incompatible types: String cannot be converted to int" below…
-
1
votes0
answers214
viewsProblem when a relationship persists
I have 2 entities, the Submodel has a list of possible Options. I made a unidirectional Onetomany relation, when I make any persistence in the entity Submodel that the list of Options this empty the…
-
1
votes1
answer102
viewsHow to turn Double into Binario Java
I tried to do the method of turning the result of a calculation like this -> public String converteResultado(String resultado) { return…
-
1
votes1
answer77
viewsC# - Collections - Enigma Exercise
Hello, I was making a college exercise list and I came across this exercise, where you have a part of the code and it asks you to find out what code structure it belongs to. In my view, this seems…
-
1
votes1
answer162
views -
1
votes1
answer206
viewsKnow the color of Button Android Studio (Java)
Good afternoon, I need to know how to read the color of the Button and store in a variable in java for Android platform but is showing errors, can help me ? Follow my code below: private EditText…
-
1
votes4
answers295
viewstake only the decimal of a double
How do I enjoy just the decimal of a double? I’m trying to print the decimal part of a number in monetary unit, R$ 102,33 -> I want to print only thirty-three cents. At the moment my code is like…
javaasked 5 years, 5 months ago andrecatete 11 -
1
votes0
answers41
viewsPassword with numbers together
has a new password typing templates with 5 buttons and the numbers are together, someone knows how it works or if there is some library for it; Follows image for better understanding.…
-
1
votes0
answers92
viewsTwo-page report (sub-report) does not generate second page
The problem is this. I have two reports from one page each and I want the second to be the sub-report of the first. The second is in the band Summary of the first as a subreport, but when the first…
-
1
votes2
answers43
viewsHow to check if there is an update in google play for my application
I have an app published on google play, where now I have the need to check if there is an update for it, in case there is I need to do a routine. Is there such a possibility?
-
1
votes0
answers28
viewsHow does matrix3d() work in CSS?
Well, I know to work with matrix()is followed by 6 2D transformation methods in a single method. If I had the following code matrix(1, 0, 0, 1, 0, 0). Each number would represent a method that would…
-
1
votes1
answer141
views -
1
votes1
answer763
viewsFilewriter and Fileoutputstream: when should I work with each of them?
Often we find codes that could be solved with the use of objects of the type FileWriter or FileOutputStream. For example, a simple code that writes "Teste" in the archive /tmp/arquivo: With…
-
1
votes2
answers79
viewsJlist - does not update when I log in again
private DefaultListModel model = new DefaultListModel<>(); //modelo da lista de ficheiros private JList listaFicheiros = new JList<>(model); new1.addActionListener(new ActionListener(){…
-
1
votes3
answers813
viewsHow to find Session in Hibernate 5.2.3.Final
hello! Guys I’m changing my Hibernate from version 4.3.8.Final to 5.2.3.Final. Now I’m not getting the Hibernate Session like I used to, like this: (Session) manager.unwrap(Session.class); Gives…