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
votes0
answers266
viewsCustom Sonarqube Rule Construction
hello! I am creating a plugin in Sonarqube with custom Rules and as my first Rule, I want to do a validation in If declarations where an alarm is triggered every time a literal String enters as…
-
1
votes1
answer105
viewsError in the webservice calculator implementation
I’m mounting a calculator equal to Ricardo Lecheta’s book for understanding of webservice, but I’m 2 mistakes caused by a bad conversion of DataInputStream values that should be received, with the…
-
1
votes0
answers464
viewsExternal js function in jsp
Hello, I intend to use an external js Function, a js typeahead, and call it in my jsp input, but it’s not working accordingly. Js import to my jsp. <script src="javascript/todospaises.js"…
-
1
votes0
answers172
viewsHow to avoid multiple JAR downloads with JNLP?
I have a JNLP-based application, but each time the user clicks on the JNLP file, javaws downloads all the jar’s of my application even without any update on the server side. I have read all the…
-
1
votes1
answer158
viewsDebugging error on TDS 11.2 (Eclipse) on Linux Mint 18
I configured the debug with the path of smartclient.exe (use via Wine), the build works, only the debug that gives a permission error in java. Iniciando TOTVS Application…
-
1
votes1
answer899
viewsHow to draw lines following the mouse movement?
I need a JPanel, that draws lines following the mouse pointer while it is dragged, and when released it needs to stop drawing. It turns out that whenever two or more lines are drawn in a row, they…
-
1
votes0
answers87
viewsMulti-threaded chat
Guys I’m developing a chat bot, the question with the answer that the bot gives is all right, my problem is when more than one person comes in contact with the chat, he is treating as if both are…
-
1
votes1
answer1508
viewsView an image with Java Swing Jlabel
I’m trying to display an image in an app using Swing Java. I take some frames from a video and display them as an image private void updateView(){ Image tempCurrent =…
-
1
votes1
answer447
viewsHierarchical selects. Parent-child relationship in the same table
I have a Product Entity regarding @Manytoone. And I need to bring the last child record of each parent. I made a select in the table and this bringing what I need more I’m not right to do the same…
-
1
votes1
answer148
viewsProblem switching between charts using Cardlayout
Hello, I’m having problems using Cardlayout to display the two-class graphics. I intended to show each graph at once and display the other at the push of a button, however when I press the button…
-
1
votes0
answers99
viewsSave a jsp form
When you save a form, that is, you go to the Spring Controlle class, I need the same to make an exception, to warn the user that some field is required. In JSP it looks like this: <c:if…
-
1
votes0
answers48
viewsHow to cut two images in the same Activity?
I’m using this repository to cut images. But I’m not able to cut two images in the same activity, and one is oval and the other is rectangular. Every time I click on both, the cut is the same. Below…
-
1
votes0
answers146
viewserror while trying to upload application using Wildfly
I am learning EJB, and I received a project that uses EJB, only that I decided to use Wildfly. when I upload application presents an error. service…
-
1
votes1
answer237
viewsHow to bring a List in a JPQL query with constructor
Good afternoon, I’m doing a jpql query to bring up a VO(Value Object) with some information, one of them being a List. This list is in the object opCambio, however, is returning me this error: Log:…
-
1
votes1
answer197
viewsIs it possible to modularize JSF registration formularies?
The question is this... although the problem does not involve JPA/ORM I find it interesting to contextualize. My little project has a @Entity Addressee and as the name suggests it is an entity…
-
1
votes0
answers114
views -
1
votes1
answer763
viewsJSON doesn’t convert special character?
I have a ArrayList and when will I convert him to a Json using the Gson special characters do not accompany serialization. Obs My bank and project is in encoding utf8. I am Serializing the ArrayList…
-
1
votes1
answer531
viewsHow to create a textView by code in a specific Activity location?
I wonder how to choose the place where the textView created by code will appear, because by default it is created at the top left of the Activity. Activity: package genesysgeneration.classsound;…
-
1
votes1
answer765
viewsHow to resize the application with the monitor?
I have an app that opens a JFrame, having at the top a JMenuBar. Until I call an item from Menubar one JTabbedPane, is hidden and as soon as a menu item is chosen, a Tabbed with jPanel inside opens.…
-
1
votes1
answer270
viewsError while using Adrequest
Could help me find the error in this Oncreate method specifically in the Adrequest class? @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
1
votes1
answer44
viewsWhy does the connection pool close before displaying Sqlite data?
I am trying to display BD data in a Recycleview but get the following error: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.emerson.drawer, PID: 8316 java.lang.IllegalStateException:…
-
1
votes1
answer1567
viewsHow to compare, remove equals, etc elements of two vectors in java?
I am doing a work in java to perform operations together, but as I am learning now I do not know how to compare the elements of vectors to make the following operations, union, intersection,…
-
1
votes0
answers395
viewsJava Hibernate Query (HQL) with foreign key... ERROR!
I need help with my code, I have two tables: -CDF (official register) CREATE TABLE public.cdf( ativo character varying(1) COLLATE pg_catalog."default", reg integer NOT NULL, nome character…
-
1
votes1
answer177
viewsCreating a "match" system with days of the week and different periods between two matches
When I was doing a university project, I came across a problem that proved to be an obstacle. I need to create a system whose user is required to select days of the week and periods (night, day,…
-
1
votes1
answer40
viewsHtttpurlconnection functions missing in Xamarin Forms development (Java System Conversion to C#)
I have a system developed in Android Studio and am passing to Xamarin Forms in C# and this happening some errors that I am not able to solve Summarizing what my system does: It takes the html page…
-
1
votes0
answers80
viewsError using split function and removing certain characters from a java file
The idea is to separate pieces with the split function that does not contain spaces, comma, point and comma, etc. But the function does not separate correctly, separating most of the time only…
-
1
votes0
answers73
viewsIncorrect date/time format
In my next code snippet: String horario = evento.getDataOcorrencia().concat(" ").concat(evento.getHoraOcorrencia()); horario = horario.replaceAll("/", "-"); SimpleDateFormat dateFormat = new…
-
1
votes1
answer107
viewsHow to summarize a long text using Thymeleaf?
I have an object with two attributes, one is id and the other is strring type attribute called text type "TEXT" (postgres database) which is used to store the text of a customer post. When the app…
-
1
votes1
answer74
viewsDoubt about logic, ifs with multiple checks
I have a code where I need to verify that two entries are true. I’m doing like this: if (!estudante.getOutTotal.equals("0") && !estudante.getOutEmAtendimento.equals.("0")) { // Faz algo...…
-
1
votes2
answers56
viewsError returning reply with search method
I’m having trouble trying to do a search in the bank and return the answer on the screen. This is my main class: public static void main(String[] args) { pessoaDAO ps = new pessoaDAO(); try { Pessoa…
-
1
votes1
answer211
viewsUpdate dialog component
I have the following dialog: <p:dialog header="#{encomendaController.objeto.id == null ? msg['cadastrando'] : msg['atualizando']} Encomenda" widgetVar="cadastroEdicao" minHeight="80"…
-
1
votes0
answers52
viewsFind arrayAdapter
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu_search, menu); MenuItem item = menu.findItem(R.id.menuSearch); SearchView…
-
1
votes1
answer111
viewsHow to reconcile good Object Orientation practices and ORM frameworks for getters and setters?
In many of the systems I have worked on or had contact with, the class representing a model is usually a POJO, which we map your attributes for columns (for relational banks) or attributes (for some…
-
1
votes2
answers407
viewsHow to Store Splitted Strings in an Arraylist?
I’m doing a job where I need to save the information from a current account, I need to read the information from a file (text) and split this information into account code, name and balance. Also, I…
-
1
votes1
answer179
viewsChange Dialog is not displaying data
I have a Maven project that is using jsf, jpa and primefaces in which there is a dialog that is being used to do the altualization(update) of the data, only, inputText is empty when it is called…
-
1
votes0
answers140
viewsA boolean button and dynamic menu with jsf Programming java html primefaces jsf
Hello, I need to make a Boolean button with jsf (primefaces) and html and a dynamic menu that one button calls another, only I have no idea how to do. Can anyone help me? I started doing something,…
-
1
votes0
answers259
viewsThread initialization using runnable interface
I’m having a problem creating some threads: The mistake is: "The method Actualizprodutorunnable(Affiliate, List, Arraylist) is Undefined for the type Home" in Main Class: for (Filial filial :…
-
1
votes2
answers1134
viewsConcurrentmodificationexception how to proceed?
I have the following method: private void houveAlteracao(Long id) { try { Objeto objeto = service.find(id); objeto.setEventos(JsfUtils.ordenarListaEventosPorHora(objeto.getEventos())); Objeto obj =…
-
1
votes2
answers507
viewsError entering data in Sqlite database
Class creating the bank public class CriaBanco extends SQLiteOpenHelper { private static final String NOME_BANCO = "lista.db"; private static final int VERSAO_BANCO = 1; public CriaBanco(Context…
-
1
votes0
answers57
viewsConflict between Listview’s latest Ell and Floatingactionbutton
On the last Cell of mine ListView there is a conflict because the FloatingActionButton screen is covering two buttons as shown in the image: I wish I could enlarge the scroll area of my ListView or…
-
1
votes1
answer122
viewsHow to capture the colors of a label that is behind another label?
I have two Jlabels superimposed on each other. JLabel label = new JLabel(); label.setBounds(15, 15, 300, 300); label.setOpaque(true); label.setBackground(Color.red); JLabel label1 = new JLabel();…
-
1
votes0
answers48
viewsMessage system (GCM) for local application
I’m after some system like Google Cloud Messaging, to send notifications to a local application, a supervisory made in java, running locally (it in turn connected to a microcontroller). The idea was…
-
1
votes1
answer3816
viewsHow to make a query in Sqlite?
In my project the user must register to enter, when placing the data name, email and password and when clicking the registration I would like to check if the email already exists, how to do ? I have…
-
1
votes2
answers207
viewsProblem with String Comparison Denial
A part of my code: // faça: do { System.out.println("Você deseja sentar na Janela (J) ou Corredor (C) ?"); opcaoSentar = leer.next(); // se a opção foi J if (opcaoSentar.equals("J")) {…
-
1
votes1
answer65
viewsProblem to recover data using Hibernate
I can list the Customer and their Animals, but I can’t list the Animal Breeds. Follows the involved relationship classes: Client class @Entity public class Cliente extends Pessoa {…
-
1
votes1
answer5444
viewsHow to map entities with composite keys in JPA?
I have a system where all tables in the database have a column empresa, which is part of PRIMARY KEY. In the client table, I have a column id (autoincrement), which together with the empresa form a…
-
1
votes0
answers69
viewsRepulsion method based on Helbing model
I’m developing a crowd simulator following Helbing’s Social Forces model, only I’m having a problem at the moment of the collision between agents. When the collision occurs the repulsion method is…
-
1
votes0
answers107
viewsHow can I expect a response from the user?
Hello, I’m making a game Genius, the one who needs to select the colors in the right order... And I’m having a little trouble with the player’s turn... public void jogadorJoga(){ } In this method I…
javaasked 7 years, 6 months ago Kelvin Crepaldi 41 -
1
votes1
answer80
viewsConsume . jar in java web project
I created a file. jar (script.jar) that contains the "print()" method only returns a string and would like when I clicked a button on my Java Web application (Javaee) this "print()" method to be…
-
1
votes1
answer748
viewsOne-way Onetomany relationship
Hello, everyone! Help me! I have a financial system and I am in doubt in the relationship of User and Account, according to UML. From what my teacher told me, here we have to make a Onetomany in…