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
answer62
viewsToast with problem
I’m new to android,my question is silly,my Oast was only to appear when the user type the wrong password or email,but it appears even when it is correct, what is wrong with my code? try { JSONObject…
-
0
votes1
answer63
viewsPerform a search from a certain date
I’m reading a csv file that generates data from when a particular page was accessed. However I am not able to implement a method that allows me to perform the research from a date I wish. Follow the…
-
0
votes1
answer184
viewsHow to change Growl’s position on the screen?
I want to change the position of Growl but apply in CSS and at the time does not change anything in the position when it appears on the screen, I want to center for example. In the template:…
-
0
votes1
answer596
viewsWhy doesn’t the app come off the white screen and make no mistakes?
I’m making a very basic app with a screen that simulates a Bingo card. The problem is this, when I run the code, without checking repeated numbers (because in a bingo card there can be no repeated…
-
0
votes1
answer481
viewsHow to manipulate the site of Jlabels by having a wallpaper?
I’m trying to make an app that has a wallpaper, but I can’t change the position JButton or JLabel. I can only do it if I don’t have a background. Follows my code: public class teste extends JFrame{…
-
0
votes1
answer207
viewsChanging label and color of pie chart entries - Android
I have the following code: public class Pontuacaouseractivity extends Appcompatactivity { PieChart graficoUser; int pontosCor, pontosNumero, pontosObjeto; FirebaseUser user; FirebaseAuth auth;…
-
0
votes2
answers508
viewsHow to check if a String is null and add in an array?
I have a problem, I have several variables (String) with the following names: textTransferd1, textTransferd2 to 73 (textTransferO73). At certain times the variable textTransferd2 for example may…
-
0
votes1
answer1112
viewsResponse to preflight request doesn’t pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested Resource
I am running client/server tests where the client is being developed with Angularjs and the java server + Tomcat + jersey. When I try to do a client-side post, it gets to the server at the right…
-
0
votes1
answer268
viewsjava.lang.Nullpointerexception error using Scanner
In the following code generates the following error: Exception in thread "main" java.lang.NullPointerException at…
javaasked 7 years, 4 months ago Diogo Lopes 35 -
0
votes1
answer88
viewsToast She’s in trouble
Man Toast is being shown even when my Else is not called; it was to be shown only when the user enters wrong password or email, but even when the equals works, the Toast appears: protected void…
-
0
votes1
answer38
viewsUcanaccess problem in Select with Between Dates
I am having a problem when performing a query having as condition a period of two dates, this query in MS Access works perfectly however via code with ucanaccess library I get the error of 'Unknow…
-
0
votes1
answer262
viewsError While Uploading with Bootstrap fileinput
Well I’m having problems with this plugin would like to know if anyone has messed with it and if it could help in the question I am having problems communicating with the controller I am taking the…
-
0
votes1
answer207
viewsManipulating dates
I have doubts about the steps to manipulate dates. The steps below are ok? Can I start studies? I have the attribute Date and I want to insert 2 days. Convert Date in String. Convert String in…
-
0
votes1
answer233
viewsYou are not setting the value in the.setParameter query when trying to make a query in the database
I’m having a problem when it comes to setting a value on query.setParameter. Use Ecliselink and Mysql, I made a query without setting parameters and it worked, I wonder if it can be? Class where I…
-
0
votes1
answer263
viewsShow message on screen if there is no internet connection
I created an android app that consumes data from a webservice Rest made in Php, so far everything working perfectly. What I want now is to show a message on the screen if you do not have Internet…
-
0
votes0
answers662
viewsHelp with Java Dynamic/Chained List
I’m having a hard time with a Java method. To delimit the Node position, I only have the getProximo() method as follows below, so I cannot delete the Node passed as parameter, without excluding all…
-
0
votes0
answers412
viewsConverse between Decimals and Binaries in a vector, with randomly generated elements
I need to make a program where 10 randomly generated numbers that are stored in a vector are converted to binary and shown to the user. Not necessarily will need to be stored in a vector. I just…
-
0
votes1
answer928
viewsWrite the average of the numbers typed, if they are even. Finish reading when user type zero(0)
Ex) Write an algorithm that averages the numbers typed by the user if they are even. Finish reading if the user type zero. I did so: public static void main(String[] args){ Scanner x = new Scanner…
-
0
votes1
answer163
viewsScroll Webview does not appear
I created my first application on android being that it was (Webview) but when I enter the application, my site is fixed inside, no scroll. My code is: package…
-
0
votes1
answer94
viewsError while trying to generate signed APK. What may be wrong?
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission…
-
0
votes1
answer159
viewsAssigning lines from a document to a String array
I am trying to assign to a string array certain document lines, the content of the document is this: 3 50 5,80,0 15,5,1 12,30,0 I want, from the third line, each row to be stored in a given Dice of…
-
0
votes1
answer1232
viewsRemove the last value of an array
I have a basic college project and one of the requirements of the exercise is to remove the last value from an array of integers. I am not able to do with the last value be removed without using an…
-
0
votes1
answer482
viewsObject disappear at a certain place on the page
My question is this:: I want/need a code for my website, which works as follows: When the user uses the mouse scroll to scroll down to near the footer of the page, the Div called for example:…
-
0
votes2
answers523
viewsConsume PHP Webservice using Java/Android
I built following the guidance of a friend a webservice using php (actually is a web application that returns to all requests made via post a string in format json). First what I’d like to know is…
-
0
votes1
answer112
viewsError while converting types
I am doing a job for the college that consists of creating an immovable array based on some rules that are provided by txt. The code gives error and do not know what is occurring. A detail that when…
-
0
votes1
answer867
viewsConfigure Spring Boot with Swagger to generate documentation from a json
Good morning, everyone. I’m documenting a project’s Apis using Swagger2. In this documentation instead of using annotations a json file is used. I wonder if it is possible to create a Spring Boot…
-
0
votes2
answers1543
viewsAggregation in Java
I would like to create a method in my class Teacher that would calculate your salary based on your workload, which is a function established in the Discipline class, a teacher can teach several…
-
0
votes1
answer762
viewsHow to Save the File Path to the Bank
I am having a doubt I would like to know with saving the path of images and files that I currently upload I save this files in a folder but I would also like to have the path in the database how can…
-
0
votes2
answers99
viewsArray returns wrong value in java
I have a question about a college job. I can read with numbers, remove ";" and pass the values to the array while reading the file. However, when I try to access a position of the array outside of…
-
0
votes1
answer358
viewsHow to generate a pdf with Primefaces 5.3 using dataexport
This is my screen to generate the pdf <p:panel style="margin-left:30%" id="pnlTituloGabarito"> <p:commandButton value="Export to PDF" ajax="false"> <p:dataExporter type="pdf"…
-
0
votes2
answers301
viewsNull Object Reference JAVA
The whole problem is happening in a search, when I click and start typing the field it goes filtering the results, when I click on one of these results to open another screen, this error: Attempt to…
-
0
votes1
answer85
viewsEnvironment for Android database testing
I am developing a simple application with Android Studio, using Java as a language. Currently, I am implementing the login and logout routine and I have some doubts. 1° ) Is there a need for me to…
-
0
votes0
answers50
viewsProblem with Tabs and Adapter
I got a problem here. I have that code Home Screen: public class Inicial extends AppCompatActivity { private ImageButton button,button2; protected void onCreate(Bundle savedInstanceState) {…
-
0
votes1
answer36
viewsI cannot display the value received from the server
I am working on a project written in Java with a Client structure - Server. My client consists of Swing Graphical Interfaces and the server working with multi-threads. But I’m at a point where I…
-
0
votes2
answers54
viewsWhat do I need to change in this method to work properly?
This method searches, by the Customer’s phone, the Reservations that are made in it. The Customer may have more than one reservation, but the method is only showing the first reservation registered…
-
0
votes1
answer93
viewsApplication Stopped Webview
I have an app with a WebView, after inserting a code so that it could return to WebViewWhen pressed the close button of the mobile phone an error was detected, but this error ("The Application ***…
-
0
votes4
answers645
viewsHow do I insert a button after a listview?
Hello, I need to insert a button right after my listview. I mean, when I finish sliding my listview will have a button at the end. I’m trying to do it this way: <LinearLayout…
-
0
votes0
answers36
viewsSharedpreferences receiving Nullpointerexception
I need some help with Sharedpreference. I am developing a phrase APP, where there is a checkbox that marks favorite phrases and plays these phrases in Sharedpreferences where they can be accessed…
-
0
votes2
answers77
viewsAlgorithm problem
Statement: Read 3 integers and order them in ascending order. At the end, show the values in ascending order, a blank line and then the values in sequence as read. public class ex10 { public static…
-
0
votes1
answer807
viewsHow to hide keyboard when leaving Edittext?
I have three edittext, I want that when I click out of them or finish filling my keyboard sum. Being that they are a Fragment. How to do this? My XML with editText. <RelativeLayout…
-
0
votes1
answer93
viewsString Handling - Javafx Application
I’m having a problem I’m reading a file and I need to remove the accents of the string, however, the function is not working in my Javafx application. Function: public static String remove(String…
-
0
votes1
answer327
viewsAdd items to the top of Recyclerview with Firebaserecycleradapter
How do I add items to the top of a RecyclerView using the FirebaseRecyclerAdapter? By default, whenever I add an item, it goes to the bottom of the Recyclerview list, and I want it to go to the top.…
-
0
votes1
answer82
viewsI can’t use Loginbutton from Facebook SDK
Every time I try to insert it the application compiles but does not run, closes automatically with the following exception` java.lang.RuntimeException: Unable to start activity…
-
0
votes1
answer716
viewsOpen Activity if you don’t have internet
I have two Activity one has a webview and another is a page where if there is no internet should be displayed it. The problem is, when there is no connection, there is an error and it says that the…
-
0
votes0
answers133
viewsSonar-Runner does not use files
I installed the local sonar in my Ubuntu and I’m trying to raise some figures for it. I set up the sonar-project properties. as follows: sonar.projectKey=your:project-key sonar.projectName=Project…
-
0
votes2
answers90
viewsProblem Handling a list of Objects in jsp
I’m having trouble handling a list that comes from my controller in my jsp I believe I’m not using the right way to treat and go through this list follows my controller who creates the list.…
-
0
votes1
answer92
viewsHow can I avoid repeating code?
I have a command that will need to perform several executions, but I have to put 1,2,3... have to use the same name ? btnadd1.setOnClickListener(new OnClickListener() { @Override public void…
-
0
votes1
answer1391
viewsHow do I login?
I’m having a problem logging in. I have a simple page: I only need to consult in the database if the value informed by the user is equal. This one here: Model: @Entity public class User { @Id…
-
0
votes1
answer81
viewsHow to create a Chronometer in a notification?
I have the following method below: public NotificationCompat.Builder createNotification(Context context) { Intent intent = new Intent(this, MapsActivity.class); PendingIntent pIntent =…
-
0
votes0
answers135
viewsHow to fill the entire screen in "Landscape" Table Layout mode?
I am using a "Tablelayout" in my application. This is my XML code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"…