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
votes0
answers44
viewsProblem with spinner selection
I have been running a project and found the following problem(s): endAllActiveAnimators on 0xd0f0b880 (Dropdownlistview) with Handle 0xdd169490 I don’t know what you mean, can someone help me? Here…
-
0
votes0
answers17
viewsDoubt in syntax
I was seeing a code and saw this part with some things I didn’t understand. What does this part " > 90 ? 1 : 0 "? campo[x][y] = random(100) > 90 ? 1 : 0;
-
0
votes0
answers5
viewsUpgrading Gradle to 6.x
I am updating the version of Gradle of my application, it was with version 2.3 and I am going to 6.7.1 and I am not able to solve this problem: Could not set Unknown Property 'testClassesDir' for…
-
0
votes1
answer95
viewsRewrite code using the Try-with-Resources resource
My problem is to rewrite a code using the Try-with-Resources feature, as I’m new in the world of programming I’m not being able to learn how to do this, which is becoming something exciting, because…
-
0
votes1
answer22
viewsHow to use Scanner to define the characteristics of the "product" object
public static void cadastrarProduto(String nome, int codigo, int quantidade, double valor) { var produto = new Produto(); Scanner leitor = new Scanner(System.in); nome = leitor.next(); produto.nome…
-
0
votes0
answers198
viewsJava error running via jar
I have a code that makes a request to a WS. When I run via Netbeans, the code works perfectly, but when I do it via java -jar programa.jar the system shows the following error:…
-
0
votes2
answers257
viewsAssign Value to a Non-method Array
I need to assign a value to an Array and throw it out of a method, but for this I need to take the values that are obtained through this method, to later use this Array obtained in other methods or…
-
0
votes0
answers113
viewsSend java image to javascript
I’m developing a web service Rest with Spring in Java which provides images to front-end, which calls Java with an ajax event. On the server side I am using java Image. import java.awt.Image; I…
-
0
votes1
answer1159
viewsSearch box in Java
I am creating a Java system using Netbeans. I would like to create a search box that shows the results in a list (of variable size) below the box as the user enters the text to be searched. It would…
-
0
votes0
answers455
viewsUpdate datatable
I’m having trouble updating a primafaces datatable after doing a filterBy search. First, I do a search through a method in managedbean to bring the list from the bank to the table. Therefore, I…
-
0
votes1
answer68
viewshow to make tap function in android notification
Hello, I have the following situation, is a chat, and the user receives a message.. I want that when the app is minimized it receives an alert... The alert part I’ve done and it’s working:…
-
0
votes1
answer389
views -
0
votes1
answer668
viewsMaximum number of options within the JSTL <c:Choose> tag
People recently was working with JSTL and I came across the following situation, I tried to add 3 tags when within a Choose tag and the last tag just doesn’t work, the code was like this:…
-
0
votes1
answer2642
viewsHow to display an entire variable in a textView and add +1 to it each time I click on a button present in the same Activity?
I would like textView to display the value of the variable I created in Mainactivity "int numero = 0". package genesysgeneration.a10; import android.support.v7.app.AppCompatActivity; import…
-
0
votes1
answer57
viewsPass Volley api data to another screen
I have an application that gets given via api using Volley My code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
0
votes1
answer186
viewsProblem with Datatables ID
I’m doing a project and I have a question/problem... I have a Datatables with the following content: "aoColumns": [ {"sTitle": "<input type='checkbox' class='pull-left'…
-
0
votes1
answer147
viewsApplication works in eclipse and stops working after generating JAR executable
I am working on two apps here in the company that are giving me a certain headache for a reason that the solution should be simple but I am not able to locate the error, the two applications work…
-
0
votes0
answers400
viewsAjax does not work, selectOneMenu cascading
I am developing a program but ajax does not work at all. I decided to make a very simple system to see where the error is and still can not a solution. I saw some of that on the forum but I couldn’t…
-
0
votes0
answers275
viewsReturn a method value (JSON Array)
Hello, I have a method that fetches the URL through JSON and wants to return this method value to mainActivity, to show. package com.example.fabio.domoticaa; import android.content.Intent; import…
-
0
votes1
answer308
viewsIgnore parameter if null
I have the following method that does a database search: public Collection<Habilidade> pesquisar(HabilidadeForm form) throws Exception { String query = "select u from Habilidade u where u.nome…
-
0
votes2
answers941
viewsHow to save the Maven dependencies inside the project folder?
I want to save all the dependencies of the Maven project inside the folder of my project! What should I put in the pom.xml file? Is there a plugin for this? I would like a pom.xml template that…
-
0
votes0
answers29
viewsMethod not saving photo file
I’m making an application on Android, only I can’t save a photo file. btnFoto.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { // Intent de camera Intent…
-
0
votes2
answers1299
viewsbuild-impl.xml:930: The following error occurred while executing this line:
I’m doing a college project, and every class I put together to inherit from the class Modelo, I get these mistakes.…
-
0
votes1
answer77
viewsDisplay value from another screen
Hello I’m working with the following code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_conversor); String t =…
-
0
votes0
answers325
viewsControl position change of a recyclerview through a progression
I’m trying to make a routine, where I control my item passage from my recyclerView by a progressBar, I mean, every time I change the item, this change has to be reflected in the Ogress. The problem…
-
0
votes0
answers36
viewsNo Output with Datainputstream
I am trying to build an application that works as a terminal emulator, but simply no output is generated. Here’s my code, it might be useful: package me.craftygaming.TermDroid; import…
-
0
votes1
answer199
viewsProblem when receiving, via Intent, a file shared by another app
I’m having trouble opening the shared file via Intent. I can properly receive the path to the file but mine app closes the execution. And unfortunately I’m not able to capture the error generated.…
-
0
votes2
answers1507
viewsJava and Hibernate date formatting
Good morning, everyone! I am trying to return a formatted date, is in the database as date, but for return could be a string msm. Some friends have indicated two modes, either creating a new method…
-
0
votes1
answer174
viewsHow to consume a Multipart form-data method with void method
How to consume a method Multipart/form-date of a web service made in java, by ajax or jquery? Below I leave as this the method: JAVA: @POST @Path("/aprovarCompra") @Consumes("multipart/form-data")…
-
0
votes2
answers588
viewsLoad table view with Observablelist
I’m trying to load a table view with the result of a query. The result of the query is sent to an Observablelist which is then called in the controller. I do not get any error but it also does not…
-
0
votes1
answer66
viewsParameter is not coming as null
I am working on the internationalization of my messages and their centralization. I have the following methods: private static void addMessage(Severity severity, String mensagem, Object...args){…
-
0
votes1
answer1029
viewsThymeleaf - Submit from inside information <table>
It is possible to give information ubmit from within a using Thymeleaf? Example: <form method="post" th:action="@{/receive}" th:object="${objeto}" > <input type="text"…
-
0
votes1
answer367
viewsOptimization Inserts Hibernate when there is relationship @Manytomany
Imagine the relationships: User has Many Permissions Permission has Many Users We can create a relationship of N para N as follows: User class. public class User { /*Many attributes here*/ private…
-
0
votes1
answer425
viewsHow to validate if a String already exists in the Jcombobox list?
It follows the code that I am locked, I wonder how do I validate if a directory that I will add, already exists in JComboBox? package view; import java.awt.BorderLayout; import java.awt.EventQueue;…
-
0
votes1
answer572
viewsSend information from one JSP to another via Servlet
I have a page to list all the projects. Each project will be shown the edit button. I would like to send the project information from the list page to the edit page via Servlet. When sending this…
-
0
votes0
answers313
viewsPassing parameters from an Activity to a calculation class
I would like you to help me in a situation that I am doing in my project, but that somehow the app to by clicking on the calculate button. I’ll give you a simple example to get a sense of more or…
-
0
votes1
answer94
viewsInput formatting
I am solving a paper on the problem of transportation. Only that all my entries are delimited by a ENTER I would very much like to 1.read two integers (separated by space) 2.Give a ENTER 3.Read an…
javaasked 7 years, 8 months ago Sergio Souza Novak -
0
votes1
answer98
viewsMediaplayer and Thread
Good night, I have an Activity in which I play a bell x times, for t time, and for that I use a Mediaplayer inside a Thread, as below: public void tocarSino(final int repeticao, final long…
-
0
votes1
answer300
viewsHow to transform the feedback (Finditerable) from a query in the database (mongoDB) to a list of objects of type DTO.
Bank structure: >db.produtos.find().pretty(); { "_id" : ObjectId("58879057e53276e2f7bf43be"), "descricao" : "Bisnaguinha", "preco" : 4.8 } { "_id" : ObjectId("58879067e53276e2f7bf43bf"),…
-
0
votes1
answer62
viewsUse user-selected content in Combobox as key (map) in Enum class
All right, you guys? With a difficulty. That’s exactly what the title says. Code containing the Cbox: JFileChooser fc = new JFileChooser(new File(pastaPadrao)); String[] siglaStrings = {…
-
0
votes1
answer107
viewsHow do I work with LONG "data" inserted in an editText?
I tried to pass numbers that would be inserted in 3 editTexts for 3 variables long that I created: l01, l02, l03. To that way work them and make a very simple account. Mainactivity.java: package…
-
0
votes3
answers2541
viewsTaking String values from Arraylist<Object>
I take all my values from the database and put them in one array list<object> i would like to know how to access the value within this arraylist emu, for example TesteLinhas.get(0).toString()…
-
0
votes0
answers461
viewsMethod for calculating punctuation
I have a file resultados.txt where is the id of the two teams and how many goals each scored in the game. Through this file is created another file where is the name of the team, the total points of…
-
0
votes1
answer67
viewsDagger 2 does not generate components
Every time I try to give build in my project the following error occurs: Error:Execution failed for task ':app:compileDebugJavaWithJavac'. java.lang.NoSuchMethodError:…
-
0
votes4
answers148
viewsBackground of Imagebuttons
I have a ImageButton and when I click on it wanted the Background of him passing to another ImageButton. Have View v of the first ImageButton, and imgB6 is the ImageButton that I want to receive the…
-
0
votes1
answer3178
views"What eh"/"how to resolve" a "null Object Reference" error? What appears on the console?
When I try to use the code below, (what alias I managed to get with help from friends of the OS) an error appears on the line: spinner.setOnItemSelectedListener(this); With the following console…
-
0
votes0
answers161
viewsHelp to filter json file from firebase in the application
I’m building an application that’s just an information filter that’s in the json of the firebase database. My headache is being where I’m going to apply the search code! for now it’s like this:…
-
0
votes3
answers248
viewsHow to make an Array created within an Asynctask be global?
In my original version I populated my spinner from an array, placed in the strings.xml And to know which selection the user made used the following code code 1 @Override public void…
-
0
votes1
answer163
viewsError creating Google Maps Activity
When I create in my project a new -> Google -> Google Maps Activity he creates everything correctly. Then add the key to google_maps_api.xml. <string name="google_maps_key"…
-
0
votes1
answer144
viewsUnmarked class
I am testing a . jar where I will pass named parameters on the command line, etc. The problem is that you are not finding my main class. Somebody help me? package appOptions; import…