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
votes2
answers124
viewsJava (Android) - Mathematical Equations
I need a little help. To get to the point, I was trying to create a small system of equations that would allow me to get a set of numbers with a few small particularities. Basically what I intended,…
-
1
votes0
answers30
viewsProblem accessing SQL database without error
I have a code that uses SQL , and in this database , I have a column of dates, then I have a code that what it does is return the maxID (number of Rows, ie number of dates) and I have another code…
-
1
votes0
answers36
viewsError displaying report created with Jasper report in VPS with S.Linux
I’m having difficulty displaying the report in a hopedada application on a VPS. I added the font in the project dependency Maven, as shown below: When I try to generate the report there is error:…
-
1
votes1
answer67
viewsItem Selected in Spinner does not appear in Toast
When clicking on the item in Spinner, Toast is not called, nothing appears. public class RegistrarActivity extends AppCompatActivity { private ImageView botaoVoltar; private EditText textoCPF,…
-
1
votes1
answer1279
viewsSqlexception: ORA-00257: Archiver error. Connect Internal only, until Freed
Have an Oracle database connection that makes a simple entry into the database. The process was working, but now this presenting the error below. 2017-07-13 14:25:55.929 ERROR 12062 ---…
-
1
votes0
answers174
viewsHow to request user data and save to firebase?
I’m starting in the development of android apps, and I’m having a doubt, I’m creating (le-se trying) an app like Tinder, where I have two types of users, the customer and the advertiser, both will…
-
1
votes2
answers335
viewsHow to validate a wrong typed data?
Since I could create an exception in case the user enters an invalid option, drop in exception, an error message appears and displays the menu again for the user. I created a flag starting with…
-
1
votes1
answer247
viewsHow to perform form search using ajax?
I am implementing a web application and already have the full CRUD and search implementation. However, I want to use ajax to make the system more efficient and implement the database search using…
-
1
votes0
answers220
viewsWhen making a DELETE request, the org.springframework.web.Httprequestmethodnotsupportedexception error is returned
When making a request to delete a user the following error is returned: { "timestamp": 1500142937327, "status": 405, "error": "Method Not Allowed", "exception":…
-
1
votes1
answer750
viewsMethod Returning Empty List
I am having a problem with a java method. The intention is to split a Hashmap into pages, and return an Arraylist with each page. Code: public static ArrayList<HashMap<String, Key>>…
-
1
votes1
answer44
viewsPUT or database update
How to update objects in my database via put json? This is my post code as an example, public class onbuttonclickHttpPost extends AsyncTask<String, Void, String> { protected void…
-
1
votes1
answer192
viewsList data in a datatable
I believe this method of dao that should not be correct. DAO METHOD public List <Campeonato> listarTodos() { try { manager.getTransaction().begin(); Query query =…
-
1
votes1
answer43
viewsProblem editing registration information that has unicity check
I’m developing a web application using the play framework. In the play itself has the @Unique annotation that ensures that equal data cannot be saved in the database. I added this annotation to the…
-
1
votes1
answer514
viewsCalculate the total Sales Revenue
I have a consultation page that shows the total of the revenue for each product and I want to calculate the total of the sum of the recipes but is going wrong. The correct summing in the hand gave…
-
1
votes1
answer355
views"Virtual Keyboard" - Java Android
Good, I could use a little help. I was thinking of creating a kind of keyboard with just a few buttons for my Android application but I’m not getting what I want. I intended to create this keyboard…
-
1
votes1
answer259
viewsDeclare XML namespaces in classes imported by WSDL (Jax-Ws)
I’m developing a Webservice application using Jax-Ws. In this model after importing the WSDL the IDE generates the classes that will be used in the information exchanges. But when creating the…
-
1
votes2
answers209
viewsString for Double - Help!
I’m trying to add a column of a Jtable. Any suggestions on how to do? public void actionPerformed(ActionEvent arg0) { try { double itens = 0; double soma = 0; for (int i = 0; i <…
javaasked 7 years, 11 months ago Augusto Passigatti 21 -
1
votes1
answer1067
viewshow to make a controller for the index page with Spring Boot
I have a problem. I’m not able to make a controller that loads the index page, and the index.html page is in: sr/main/Resources/templates. Controller package ao.com.biblioteca.controller; import…
-
1
votes1
answer118
viewsControl event in the field?
I’m trying to treat a possible empty search when the user gives enter in a field without typing anything. I applied a keyboard event, and every time you press enter, the field performs a search. The…
-
1
votes0
answers37
viewsScanner returning error
I’m writing the code below: public int findNet(String InputRede) { try { for (GetNetwork network : getRedes()) { if (network.getId().equals(InputRede)) { return getRedes().indexOf(network); } } }…
-
1
votes1
answer277
viewsWidfly 9.0.2 is not initializing in debug mode
In the controller of my application, I have a method with a POST request, before it was a void method, with no return, but I changed so that it already returned the generated records, after this…
-
1
votes1
answer39
viewsDeformed alertdialog
Good, could someone tell me why my Alertdialog is deformed , with that white piece on top of the text ? Here’s the code I create it in : AlertDialog.Builder builder = new…
-
1
votes1
answer2564
viewsError in Maven POM.XML file
Error cvc-Complex-type.2.4. a: Invalid content was found Starting with element 'dependency'. One of '{"http://maven.apache.org/POM/4.0.0":Parent, "http://maven.apache.org/ POM/4.0.0":name,…
-
1
votes1
answer49
viewsSettext returning to null
When I open my activity the first time, all settexts are null, the second time it works normally, what’s wrong? Activity of the settext .. autor = (TextView) findViewById(R.id.tv1); editora =…
-
1
votes1
answer284
viewsRead Javascript on all Foreach items
Guys, I have a foreach that loads several inputs, and I want my javascript code read on all inputs generated by foreach, someone can give me a tip on how to do ? Example <c:forEach…
-
1
votes1
answer323
viewsPopular dropdown list with Spring MVC Controller database
I’m having trouble finding a way to popular a dropdown in the Controller and move on to the view. Because this way I’m doing when I enter the screen to update the dropdown does not return with the…
-
1
votes3
answers467
viewsHow to get an advanced "for" score?
I was wondering if I could get some kind of control variable, from a for "advanced". For example: In a be normal, I do it this way: for (int i = 0; i < algumaCoisa.size() ou length; i++){…
-
1
votes0
answers148
viewsJava/Postgresql - Function does not return values
I am creating a webservice where I will return the values of my postgresql table. However, when I run this function, a blank screen appears as if there were no data to be returned. I purposely…
-
1
votes1
answer1909
viewsHow to use an Intent to open a PDF file by default android app
I have an android app, and wanted to know how to open a PDF file that will be on Firebase in my application. I do not need him to download the file, simply an Intent where I pass the file path (in…
-
1
votes1
answer837
viewsMy double chained list is not ordering
Class On Double package ListaDuplamenteEncadeada; public class NoDuplo { private Integer elemento; private NoDuplo anterior; private NoDuplo proximo; public NoDuplo(Integer elemento, NoDuplo…
-
1
votes1
answer223
viewsHow to remove listeners according to component status?
I have a Jlabel that receives an event, and would like to disable that event when the component is disabled (setEnable = false), and only activate it again when the component is enabled. what I did:…
-
1
votes1
answer645
viewsJDBC Java Web and SQL Server 2014 connection
I am starting the development of a portal using JAVA Web and database in SQL Server 2014. I have never worked with SQL Server and there is a problem that I am unable to find the solution. Here’s the…
-
1
votes1
answer685
viewsSpecial character error in Java
I’m having a problem here and I haven’t found anything that would solve on the internet, if you could help me, I would be extremely grateful. Well, come on, I have a java web application that uses…
java postgresql spring spring-boot character-encodingasked 7 years, 11 months ago GiovaniOliveira 41 -
1
votes1
answer75
viewsAndroid calendar for weeks and months
I’m working with calendars on Android. The goal is to show the calendar by weeks and for months. But the calendar I’m using only allows me to view by month. Xml code…
-
1
votes0
answers94
viewsJSP Highcharts AND JAVASCRIPT
Good morning I’m making a chart using the Highcharts library, I implemented it in a static way to perform the tests, but now I need to pass the information from the database to him. I read and saw…
-
1
votes2
answers270
viewsSend email by java
I am trying to send mail by java but am having an error with smtp. My code: try { SimpleEmail mail = new SimpleEmail(); mail.setFrom("[email protected]", "Teste"); mail.setSubject("E-mail…
javaasked 7 years, 11 months ago Lucas Moraes de Souza 37 -
1
votes0
answers203
viewsDisplay confirmation dialog before closing tabview tab primefaces
I’m developing a jsf web application that I need to work with tabs (similar to Chrome). For this, I am using the tabview component of the first faces that has been very useful so far. The problem is…
-
1
votes2
answers587
viewsTurn a for into lambda with variable interaction
How to turn the section below into a Lambda code? The idea is to multiply the maxScore for i so that at each interaction it increases the number, only for the first 5 results. for(int…
-
1
votes0
answers244
viewsDoes not access the Onresponse() retrofit android method
I’m making a call to a post method that returns an id generated through retrofit 2, however, in return, never access the method onResponse, I’ve tried to use other objects and formats, but none…
-
1
votes1
answer83
viewsControl animation speed using the Jslider component
Good guys, I’m developing a little project that aims to simulate the controlled environment of train tracks, where I have 3 trains circulating in a clockwise direction, where the three pass by the…
-
1
votes1
answer490
viewsSending a file by form, but not by Postman
I made a webservice with Java Jersey to send files, when I try to send files using an HTML form, it works, however, when I try to send from a client or in Postman, an error 500 is returned with…
-
1
votes2
answers467
viewsHow to store and use a vector in Firebase on Android?
I have a problem developing my app that I can’t fix and I can’t find anything that would help me. Such an app was running smoothly with data stored in variables, but when including Firebase I had…
-
1
votes1
answer118
viewsStarting Tomcat 7 (java 7)
I’m installing Jdk7 and Tomcat 7. jdk7 installation was normal without any problems and system variables have also been created and targeted. After this step was done I went to install Tomcat 7, but…
-
1
votes1
answer271
viewsHow to access a specific field of a JSON object using JAVA
I’m using Java to get information from Twitter and the REST client Elasticsearch. As a test I did a PUT of info in JSON and then used the performRequest to obtain a specific element. //create a json…
-
1
votes1
answer304
viewsError when instantiating class
I’m trying to read class data dados in the Main and he gives me mistake in mine array: cadastro[i] = new dados(); Data class: class dados { private int numero; private String nome; private String…
javaasked 7 years, 11 months ago victor pereira 11 -
1
votes1
answer169
viewsHow to keep a Textview text after the App closes
Good, I’m new to Android, but I would like to know how I can keep/save the information that is in a Textview, so that this is not deleted when close application. public class Activity extends…
-
1
votes1
answer3371
viewsConfiguring CORS in Spring Security
I need to configure Spring Security to accept requests from external applications. I do not know how to do, I have a project in Spring Boot and Spring Security where only accept request from the…
-
1
votes1
answer243
viewsFailed to customize javafx tab, top panel border does not appear
I would like the Tabpanel area that has no tab to have a border according to the image below. Currently my Tabpanel is like this, no right edge of "Enter" I would like it to be like this, but I do…
-
1
votes0
answers102
viewsUpdating the language of a Javafx application at runtime
I have a combobox that contains the languages, while selecting it stores and I would like to already apply the language update. But I wanted to do it dynamically. The problem is that I don’t know…
-
1
votes1
answer378
viewsVector: Register 5 names and their heights, then show all in ascending order.
I need to register five names and their heights, then show them all in ascending order. The problem is I can only put the heights in order, the names are in the order I typed. And also I’m not able…