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
answer45
viewsIs there a function for arrays in Java like PHP Join()?
Is there a function in Java that is equal (or similar) to Join PHP? If yes, demonstrate your use.
-
0
votes2
answers2001
viewsLogin system in java
So I made this code but it’s not passing, it goes straight to LSE even with the correct user and password. I made the changes and I instated the class where the checkLogin method is, but when I run…
-
0
votes0
answers152
viewsChart type
I would like to know, if there is any component or library that generates a "graph" similar to this one. I read the documentation from JFreeChart, and there are some kind of graphics, but nothing…
-
0
votes1
answer44
viewsHow to do in Wizzardpager, build a Fragment according to user’s choice?
I’m using the Wizzardpager based on this here. But what I want is basically the user chooses the sex of the person, and passes to another screen of Wizzardpager where in this, will choose her…
-
0
votes1
answer318
viewsGrab text from Scene Builder to create account screen
How to get text from FXML file? field of the FXML file: <TextField fx:id="usernameSU" GridPane.columnIndex="1" /> controller file: public class signUpController implements Initializable {…
-
0
votes1
answer45
views"Unfurtunately, Stealth has stopped" FATAL EXCEPTION: main
Whatever amendment I make, I still have no solution to this problem. The android Emulator keeps appearing to msg "Unfurtunately, Stealth has stopped". Being that in Main does not present any error,…
-
0
votes1
answer1990
viewsWhat is the most efficient method to remove an item from Arraylist?
I would like to know which of the methods available by the class ArrayList is more efficient to delete an item from the list.
-
0
votes1
answer706
viewsHelp with "n" primes algorithm in an Arraylist
Please I need urgent help, how to fix my code? every time I call the right error method,I am beginner and am locked in an exercise that requires primes based on a number n(in this case this.n),for…
-
0
votes1
answer194
viewsReceive jwt in Java functions
Good morning guys, I am with the following doubt, I created a java login function that validates user and password in a login request, if the login is successful it returns a jwt, I take this jwt…
-
0
votes0
answers73
viewsPrimefaces 6.1 + HTTPS = IE11 error
I put a project JSF with primefaces stop rotating with https and when we enter the IE11 a surprise: it doesn’t work! Triggers a browser error like this: CSS3111: @font-face Detected an Unknown…
-
0
votes1
answer107
viewsIs there a function that changes the background of an Activity in android studio?
Is there any way to create a function that changes the background of an Activity? I need a button that will change the Activity background
-
0
votes3
answers746
viewsToast with specific duration
How to put this Toast to last only a few seconds? For example, 10 seconds. if (mEmail.equals(email) && mPassword.equals(password)) { Intent intent = new Intent(LoginActivity.this,…
-
0
votes0
answers41
viewsI used the code of the link below, and this code below. But it does not save the title of the lines of Jtable, how to save the titles of the lines?
https://stackoverflow.com/questions/8187639/jtable-with-titled-rows-and-columns MessageFormat header = new MessageFormat("Report Print"); MessageFormat footer = new…
-
0
votes2
answers557
viewsI need to send a POST request with 4 parameters (login, password, city, XML) in java
Good morning, I need to send these four parameters to the server to issue a note, the note data will be passed by XML, which is already all correct, more as I do this request POST via java sending…
-
0
votes1
answer111
viewsNullpointerexception error while saving object
I select the object through the bean and the link in the data table change in a dialog and when giving the dialog’s Ubmit I get the nullPoiterException error. Someone would know why? Bean code…
-
0
votes1
answer27
viewsChange Layout with your finger
Hi, I’m wondering how do I change one layout to another by dragging the screen.... as if it were in a gallery but instead of photos would be different layouts Thank you!!!
-
0
votes1
answer327
viewsHow to open a dialog to search a file on Android? A Filedialog
My question is about opening files in my Android application, how to upload image from mobile to the server where I first need to choose the image on my mobile. I’d like to know what I need to use…
-
0
votes1
answer1017
viewsHow to move the Netbeans project to a . jar file?
I just did a project in Netbeans and would like to turn it into a app to run on PC, so I want to turn it into .jar. How to do this?
-
0
votes1
answer223
viewsTrigger two different events with Jbutton
I would like to know how to trigger different events using the same button. What I wanted is that, with the next click, he gave a jButton1.setText("Créditos"); and return to the…
-
0
votes1
answer690
viewsVector multiplication A and B resulting in matrix C
I have an exercise in Java here to solve but I could not understand exactly what I need to do, if anyone can give me a better explanation thank you! This is what I need to do: Given the vectors A =…
-
0
votes0
answers135
viewsJava charset - How to read correctly from System.in?
I am creating an application to exchange messages between computers using Sockets, through cmd or terminal (I want it to run on linux and windows, console application). But I’m having trouble…
-
0
votes0
answers38
viewsLinked List Java net Beans
I have a problem that is basically a public service that consists of creating a CRUD of customers and then selecting a type of service (A,B,C), and then showing by order. I am using Linkedlist but…
-
0
votes1
answer179
viewsWhat HTTP error code should I use?
The project has a login page with two email fields one and another that is your password! I have a Javaweb application and in the deployment descriptor I have some declared error pages, which are…
-
0
votes1
answer1297
viewsChange color of commandButton?
I would like to change the color of a commandButton, actually several, wanted to leave set "edit", "delete"... etc My code is like this. <p:commandButton icon="ui-icon-trash"…
-
0
votes2
answers135
viewsBecause the System.out.print.ln of this if is not played
Can someone tell me why my code doesn’t run the System.out.println(""); end if the if returns true . public static void tabelear (int tabela[][]){ for(int linha=0;linha < tabela.length; linha++){…
javaasked 7 years, 4 months ago Pedro Gouveia 505 -
0
votes1
answer44
viewsDifference in string size with Fontmetrics.charWidth and Fontmetrics.stringWidth
I’m not getting the following code: String text = "C JEA NAV/NAP GRV NAV/ELT NAV SOLA PVC EXP PRETO "; int posString = FONT_METRICS.stringWidth(text); int posChar = 0; for (int i = 0; i <…
-
0
votes1
answer115
viewsI am unable to access a Webservice written in C#, from Java
I have a Webservice written C# and need to connect to it from Java to invoke some methods. It is possible? import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Level;…
-
0
votes1
answer180
viewsHow to get the maximum value of a Java circular list?
How can I get the maximum value of a circular list using a sentinel node?
-
0
votes1
answer100
viewsProblems with editable <p:datatable
Good evening. I’m having trouble updating an editable datatable I created here. It reads the values, but does not assign them to the Managedbean object so I can persist. Follows Code of the Bean…
-
0
votes1
answer107
viewsListview Loses Focus Back
I have a list of Products, when I press product number 50 for example I am redirected to the product details screen by pressing back the list loses focus and back to top, wanted to know how to get…
-
0
votes1
answer614
viewsMark/Deselect a line in Jtable, changing its color
Good morning, everyone! I’m new to the forum, and I apologize if I opened this topic in the wrong place. Well I have a huge problem with an action that I’m trying to do in Java Swing with the Jtable…
-
0
votes1
answer162
viewsJava command to ignore Encoding
I have the following situation, work with the software A of vehicle sales, in it has the opportunity to sell and this has a media (as the customer learned the opportunity), in addition to the store…
-
0
votes1
answer657
viewsHow to check if a Jinternalframe is already open in Jdesktoppane?
How to check whether a JInternalFrame is already open in the JDesktopPane and, if so, put him in focus on others? I have tried several ways I found searching, but always opens a new frame, even if…
-
0
votes2
answers343
viewsjava.lang.Noclassdeffounderror
I am locked in a project that should be a "bank", with an account and transaction CRUD. I have to use Oracle bank because of the facul. This error happens when giving an input to the bank.…
-
0
votes1
answer321
viewsRunning code snippets in parallel
Hello, I wanted to know how to run one thread after another for a certain time, for example: Thread x = new Thread(() -> { // qualquer código, pode ter até um while(true)... }); Thread x2 = new…
-
0
votes0
answers61
viewsSqlite database creation on smartphone
I’m having doubts regarding the creation of the bank in Sqlite on the smartphone via USB. When I run my program on emulator, the bank works perfectly and smoothly. But I realize that when I do the…
-
0
votes2
answers2429
viewsSelect on Oracle - Java
I’m trying to run a connection test in the database and extract some information, just Sfor study even, but I’m bumping into the following error: Exception in thread "main" java.sql.SQLException:…
-
0
votes0
answers33
viewsSwingworker does not enter the Propertychangelistener
I created a swingworker to display a Jdialog while the code stands still waiting for the user to put his finger in the fingerprint reader Everything worked right, I set as visible inside the…
-
0
votes1
answer175
viewsSpringboot Merge
I am using Spring Full, with Thymeleaf and Springboot, but my question is about Springdata, after implementing the interface to make use of the methods that Spring provides in Restpository, when…
-
0
votes2
answers478
viewsUpdate in datatable after you have updated data
Speak guys, I have a problem updating a column in my datatable after an edit. I use a dialog to edit the desired data. Everything is saving in the database, the problem is when updating the table,…
-
0
votes0
answers558
viewsProblem generating modal window layout with form using Thymeleaf
Good afternoon. I’m managing to generate the modal windows of the bootstrap and load the data into the form, but the layout of the form is getting all messy. I’ll leave you two pictures to show you…
java twitter-bootstrap front-end spring-boot thymeleafasked 7 years, 3 months ago Cisino Junior 145 -
0
votes1
answer53
viewsproblem to reset Countdowntimer
I’m putting together a project to learn and I can’t find a solution for a timer, let’s say that time has already been selected 10 minutes and the user wants to change to 5 minutes when clicking 5…
-
0
votes0
answers263
viewsTomcat message with JSF error 403
I’m using the netbeans 8.1 to develop a JSF application, but when I run the facelets template appears the message I’m posting on the forum. Man Tomcat was installed along with netbeans, and I have…
-
0
votes1
answer129
viewsProblems (Vraptor + Hibernate request)
I’m using the Vraptor to develop a web application. More in certain tests, I saw that the Hibernate is adding in the database, but when I send the Result to my page with a new list of that object I…
-
0
votes1
answer255
viewsAfter changing Navigation Drawer icon it no longer opens
I customize that icon from the side menu and put an icon of mine. Follow the image: Problem: When I click on the Icon, it no longer opens that menu on the side. Follow the code I used to change the…
-
0
votes0
answers53
viewsHow to automatically resize div’s with image and description
I have a project in which I have products with image, description and price, I want to make the div’s resizable automatically according to the description and image. I also want a static value that…
-
0
votes1
answer177
viewsCheck if field contains a date
I have a list of a EditText's which are filled with data returned from the database. Some have a common text, for example <EditText android:id="@+id/edittext" android:layout_width="fill_parent"…
-
0
votes1
answer997
viewsTo create a summation method where the result appears in the Edit text field
I am creating an application and would like the result of the cost price operation plus profit percentage to appear in the sales price result and the latter cannot be edited at the time of saving…
-
0
votes0
answers72
viewsProblems running project with Xamarin: java/lang/Noclassdeffounderror : java/lang/Object
This always works when I try to run an Android or Crossplatform project. How do I resolve this? OBS1: I have the problem again and I don’t know what to do, I have no recourse to this.
-
0
votes1
answer55
viewsData does not persist when saving with dialog box
I have a list where I want to select the item change a product table field and save to the bank through a dialog. Knowing that a product has several historical , ie the relationship is Onetomany .…