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
answers584
viewsjava.lang.Outofmemoryerror: Java heap space (even with memory boost)
My code has this bug. But I’ve tried: Increase memory in VM settings: # custom Intellij IDEA VM options -Xms512m -Xmx1024m -XX:Reservedcodecachesize=480m -XX:+Useconcmarksweepgc…
-
0
votes2
answers151
viewsHow is the Generics syntax in C# compared to Java?
I am a Java developer studying C# and came across the following difference between the two languages: https://nerdparadise.com/programming/csharpforjavadevs Generics Generics are Much Less fiddly in…
-
0
votes1
answer114
viewsGeneral game in Java
Good afternoon guys, I’m doing the General’s game (java dice). I am in doubt on how to compare the data between them. Sequel Possible sequences: 1-2-3-4-5 / 2-3-4-5-6 / 3-4-5-6-1 Number of points:…
-
0
votes1
answer315
viewsHow to fire a method after editing an Integer column in Jtable
I need to call a method that shows the user any message. This method should be called at the exact moment the user finishes editing a Jtable column of type Integer and the user has not entered an…
-
0
votes1
answer127
viewsJava filter and working with Servlets
Good afternoon, everyone, I’m going through a really boring problem, it should be a small detail to solve the problem and I’m lost on how to seek this information that I lack. Well, enough crying…
-
0
votes0
answers100
viewsHow to generate random Firebase items inside a Firebaserecycleradapter - Android Studio
I’m having trouble generating random items received by Firebase, I read the documentation but I was confused. I want you to replace the items inside the FirebaseRecyclerAdapter according to the…
-
0
votes0
answers55
viewsAlertdialog with Listview in Firebase
Hi, I’m new to Android Programming. I’m trying to put a custom Alertdialog in an Activity in this Alertdialog I want to put a listview that calls items present in my Firebase database. But when I…
-
0
votes1
answer955
views"Location is not set" Javafx
I’ve been studying javafx recently and got caught up in writing a very simple code to open a file. fxml, follows the code and error respectively, searched the internet and already tried the solution…
-
0
votes1
answer737
viewsSpring Data JPA - Query via Specification - Manytomany and Join with Multiple Entities
Hello, I’ve assembled the following Specification class: public class ItemVendedorSpecification implements Specification<ItemVendedor> { private static final long serialVersionUID = 1L;…
-
0
votes1
answer191
viewsCommonsmail Javamail - Failed to send email
I am trying to send email using google smtp with the Commonsmail lib, in a web application, but this always generating a fault. I made a separate app and tested several settings, in which I saw…
-
0
votes1
answer108
viewsReceive a Localdatetime from an html form
Problem : I am trying to receive a Localdatetime of this input within a @Controller using a <form> using the Thymeleaf. <input class="form-control" id="dueDate" type="datetime-local"…
-
0
votes1
answer625
viewsHow to change from second to third screen?
A little while ago I started to develop a small application that is totally based on changing screens from buttons. There are still many details to be solved, but what worries me now is how to make…
-
0
votes1
answer134
views@joincolunm with foreignKey Hibernate
Hello I wanted to make a foreign key, but I don’t understand the syntax. In the Endereco class: @Embeddable @Table(name = "tab_endereco") public class Endereco { @Column(length = 40, nullable =…
-
0
votes1
answer4988
viewsPick up element in Arraylist
I’m having a problem that line: lista p = lista.get(i); does not want to take the element. Look at the method below: private void verPessoas() { ArrayList<RespostasAguaCasa> lista = new…
-
0
votes0
answers63
viewsp:selectOneMenu does not correctly filter the dataList
I have a column with the filter p:selectOneMenu . I use it to filter a column that has lines that can have one or several attributes. Then I use the Primefaces component p:dataList to show this…
-
0
votes0
answers80
viewsMain way and Junit does not run on the console
I’m using version 2.1 JPA, from Hibernate version 5, and when I run both main and Junit methods, nothing appears in the console not even any error. The client class and address contain your ids.…
-
0
votes2
answers833
viewsReturn search data to database in Jtable
I’m developing an interface that should return in a JTable values of a mysql table. I have developed the following method: public class Teste extends javax.swing.JFrame { private JTable table;…
-
0
votes1
answer126
viewsOnetomany or Manytoone?
Good evening, I have some basic beginner questions I need to create a timeline that has the following: What events occurred in a certain range of dates, who was born and who died in this range? I…
-
0
votes0
answers22
viewsAndroid - How to notify updates in the UI from a Cursorloader without Contentprovider?
How to notify updates in the UI using a Loader without ContentProvider? I’m wearing a CursorAdapter custom to show a list using RecyclerView through a Loader (Storing data in pure Sqlite, other than…
-
0
votes1
answer249
viewsSelect all Jcheckboxes by clicking button
My application has a list of JCheckBox within a Box. I want to make a button to mark all of them, but my code is giving the following error when I click the button "java.lang.Runtimeexception:…
-
0
votes1
answer84
viewsopen links mo webview without having http://or https://
I’m creating a browser for android, but I’m having trouble running the url without the need for the protocol on the link like opening www.google.com and the app automatically put http:// to stay…
-
0
votes0
answers47
viewsFileupload file format saved in sql server database 2008 with Image type
I have a problem finding the right encoding for a file that is saved in the database through Asp.net Fileupload in sql server 2008 database with Image type. I need to migrate from a web system to an…
-
0
votes1
answer2968
viewsError: unable to locate or load main class
I’m looking for the solution to the following problem, I do an "Olámundo" in Netbeans and it’s compiling, doing or other in Notepad++, I can create the class with javac Hi.java, but when I put java…
-
0
votes1
answer1715
viewsHow to set up a JSON upload with POST?
I need to make an API that captures some data from the machine (OS name, cpu usage, network usage etc.) and send as JSON. I was able to capture the data and have it displayed on the console in the…
-
0
votes1
answer607
viewsHow to make a Login and password screen using JSF
I made a login screen, on this screen the user can register through a registration button, made the registration he can access the system stating password and CPF. My system will be for…
-
0
votes1
answer224
views -
0
votes0
answers47
viewsProblem calling method on Androidstudio
I want to call a method in Android Studio, after the user selects an option. However, I have tried in various ways through getItemId(), but I call the method and nothing occurs. Is it a problem in…
-
0
votes2
answers1768
viewsHow to Pass Parameters in Jasperreports
Hello Guys good afternoon I’m having a doubt that is killing me. I have a project that has to print out a report that contains two lists and two tables. My problem is this, I have no intention of…
-
0
votes0
answers33
viewsStructure of JAVA error
Someone could help me, example at the end of the code has the option for the person to type YES or NO, as they would for if the person typed another word, appeared a message saying that is Yes or No…
-
0
votes1
answer63
viewsSendmail Java - Android Studio
Good morning, I’m developing an application, where I have the following doubts. I intend to email a form using Intent’s. The Code is apparently all OK, but when you click on the button "Send" the…
-
0
votes0
answers29
viewsInvalid Http Response
I have the following block of code public void read( String url ){ try{ urlNormal = new URL("http://"+url+"/sistema.cgi?lermc=0,33"); URLConnection conn = urlNormal.openConnection(); BufferedReader…
-
0
votes0
answers43
viewsClient is not increasing
I’m making a distributed system with 2 clients. Being that you are asking the same values for both, and not putting the other waiting. import java.awt.HeadlessException; import java.rmi.Naming;…
javaasked 6 years, 4 months ago Marcos Fernandes 61 -
0
votes0
answers139
viewsCalling a jFrame from another class in java click event
I have a Jframe with two buttons, and a second class that has a Jframe with other features... I wanted to make the second window open by clicking on one of the buttons in the first window, but I…
-
0
votes0
answers30
viewssetar Jcombobox item
I have two Jcombobox, the two contains strings referring to names of buyers and products. I need that when clicking on the table I can set the Jcombobox with the names. I saw in this forum two…
-
0
votes0
answers68
viewsThis giving error when I try to insert in my sqlite + java database
package Contas; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Scanner; import javax.swing.JOptionPane; import BancoConexao.Banco; public class ContaCorrente…
-
0
votes1
answer66
viewsListview in the Asynctask
My code does not load the data to list view when ta inside the AsyncTask, but if it is placed in the onCreateView works perfectly. public class Tab_os_Fechadas extends Fragment { private String url…
-
0
votes0
answers55
viewsPlaying sound with MIDI - Java
I wrote a code to play a certain sound, but it’s not playing. package reprodutormusical; public class TestDrive { public static void main(String[] args) { MiniMusicApp mini = new MiniMusicApp();…
javaasked 6 years, 4 months ago Lucas Oliveira 458 -
0
votes1
answer203
viewsAndroid Bullet style menu in Recyclerview item
First of all I already have an intermediate knowledge about android and I already have some apps in google play. Recently I’ve been updating the layout of my app, I have a video gallery in my app…
-
0
votes1
answer93
viewsRecover mysql tables name
I would like to recover the name of my java tables with mysql database. I don’t know if it’s correct I get a hashcode: (1) model.Campanhas@b 5cca49 (2) model.Campaigns@5c369e04 public…
-
0
votes1
answer46
viewsSimpledateformat cast String does not query in the database
I’m making a collaborative application for android, so I made a server in PHP, and send the data to this server. For a certain query I need to pass a date, from a Date Picker, here is the code:…
-
0
votes1
answer43
viewsI cannot change an attribute of my matrix
@EDIT Presenting a minimal example as requested: MAIN package teste; public class TESTE { public static void main(String[] args) { Tabuleiro cenario = new Tabuleiro(1); cenario.setVisibilidade(); }…
javaasked 6 years, 4 months ago Caio Costa 63 -
0
votes1
answer387
viewsGradle recognizes no dependency on Intellij IDE
My Gradle is configured like this: plugins { id 'java' } version '1.0-SNAPSHOT' sourceCompatibility = 1.8 repositories { mavenCentral() } dependencies { testCompile group: 'junit', name: 'junit',…
-
0
votes1
answer122
viewsJtable with monetary value in a single column
In order to implement a monetary value formatting in a jtable, I tried to use the Rafael Chaves as a base and I managed to make the code below. import java.awt.Color; import java.awt.Component;…
-
0
votes1
answer188
viewsNotice Push on Android with Onesignal - Action in the background
I have in my android application the service Onesignal working properly, so far so good. I want to make some modifications to my Sharepreference (database) each time I receive a message. I managed…
-
0
votes1
answer945
viewsjava.lang.Nullpointerexception error when sending data to a web service
I have a webservice where I’m sending some data. The return of the service is returning me this message below, in the integration manual, says it would be an internal error, wanted to understand if…
-
0
votes0
answers294
viewsApp does not appear in the list of app you can share content with
Well I have an app that serves to download and watch videos online, one thing I’ve been trying to do for some time is make my app appear in the list when sharing a link or an html page. Here is my…
-
0
votes0
answers40
viewsProblems in getting IMEI and Operator Name
i am developing an app and needed to handle the Telephonymanager, however, every time I use it gives some problem. For example: E/Mplugin: Unsupported class:…
-
0
votes1
answer88
viewsSend a message by Onesignal from Android
The code below serves to send a push message via Onesignal, when running in Netbeans everything works perfectly but when trying to run on android did not succeed. I’d like you to help me, so follow…
-
0
votes0
answers44
viewsPerform calculation with "thousand point"
I’m doing a program that when entering a value it performs a calculation, but I wanted as I typed the value in Jtextfield to be inserted the points that separates the thousands (eg 1000 to turn…
-
0
votes1
answer746
viewsJava: Dual-chained list (deck) implementation with callback, Generics, Exception and lambda
I’m doing the implementation in java, however I’m having some problems with how to integrate Generics and lambda in the deck: Deque.java: import java.util.ArrayList; public class Deque { private…