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
answers11
viewsHow would be a good practice to create a new standard record for entities?
How good would be a practice to create a new default record of the entities below? I need this because front-end requirements require at least one record for an editable table to be shown. I thought…
-
-1
votes0
answers6
viewsHow to map a list of objects in a list of primitives using Modelmapper
I have the following class in java: @Entity @Table(name = "tbcs_localatendimento", schema = "cats") public class LocalAtendimento { ... @NotNull @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name =…
-
-1
votes0
answers22
viewsI run another jFrame’s method, but doesn’t it add to the list?
Good morning ! I need to know how to fill a table with data from another jFrame. I created a function in the Viewpedido class that fills the table, but when I run it through another frame, it…
javaasked 3 years, 7 months ago Caiohenrks 1 -
-1
votes0
answers12
viewsHow to capture inheritance data with mapstruct?
I am creating an API with Spring and there was a need to make inheritance for different types of users. My entity structure follows as follows: @MappedSuperclass @Getter @Setter…
-
-1
votes0
answers31
viewsJava - problem when factorial using while
The idea is to type I type 3 numbers and calculate the factorial of each number. But I didn’t understand why the variable is keeping the value, for example. String entra; int cont = 1; int numero =…
-
-1
votes0
answers13
viewsJavafx - Login System - Can’t Verify If Username Is in Arraylist
I am developing a Customer Service program (just to practice) and I have reached a point where I need to check if the user name exists in the "database" which, in this case, is in the ArrayList. I…
-
-2
votes1
answer1136
viewscompare two java objects
good evening. I am working with an arraylist, and needed to ensure that no repeated objects are inserted. My object has a matrix[5][5] which is the main element that I need to ensure is not…
-
-2
votes1
answer106
viewsHow to leave a persistent CRUD?
I made a simple CRUD, and I wanted to save the data from it, so when I open Netbeans all the information is saved.
-
-2
votes2
answers4514
viewsHow to create menu on Android?
I’m looking to create a menu similar to this: Would anyone like to tell me how to ride? I would like some tips.…
-
-2
votes3
answers20150
viewsConverts negative number to positive
Is there a native java library that helps me in an elegant way to convert a negative number to positive. I didn’t mean to do it that way: public class Main { public static void main(String[] args) {…
javaasked 10 years, 9 months ago Douglas Mesquita 809 -
-2
votes2
answers165
viewsProblems with page transition
I’m trying to create a simple event to change page by clicking the button, but whenever I run the application it crashes when it opens. Mainactivity: package com.app.agrandesacada; import…
-
-2
votes1
answer1477
viewsIs there a Framework for JAVA Desktop programming?
There is a graphic development kit for the Java language, for desktop applications?
javaasked 10 years, 1 month ago Everton Luis 1,499 -
-2
votes2
answers739
viewsHow to make my program executable?
the graphical interface is already built and it runs if I compile. how to create the executable to run on any machine?
-
-2
votes2
answers169
viewsWhat language to study?
Following people, I am doing the 2nd semester of the course of Information System and I am in a great doubt of which language dedicate myself to learn! I would like to know what was the first…
-
-2
votes2
answers1120
viewsHow to compare only part of a Java String
String str = new String("Bruno Oliveira"); String str2 = new String("Gustavo Oliveira"); System.out.println(str.equals(str2)); //retorna false How to compare only certain part of a string?…
-
-2
votes1
answer109
viewsApp is closing, while consuming webservice
I have a problem in my application, when consuming a web service in Json, the application is closing. The idea of my application is I consume this web service to validate my email and password, and…
-
-2
votes1
answer61
viewsHttp Doubt x Https Android
I’m creating an Android application. This one calls PHP files via Httppost. I ask: what changes do I call with https instead of http (I start from the point I will use https, already certified on…
-
-2
votes2
answers183
viewsjava.lang.Nullpointerexception
Main class presenting problem in the call of the method createNew: case 1: cliente = new Cliente(); cliente.setNome(JOptionPane.showInputDialog("Nome: ")); cliente.setCpf(Long.parseLong(JOptionPane…
-
-2
votes1
answer3436
viewsSend a message to Whatsapp via system
I was reading about Whatsapi in Stackoverflow, but by the method you have described in previous questions, it seems not to be working. Does anyone know any method to send a message to Whatsapp, via…
-
-2
votes1
answer187
viewsSortby in JSF, brief explanation of what he does?
Could someone give an explanation as to the function of sortBy in the JSF?
-
-2
votes1
answer421
viewsConvert Sequence diagram to Java
I’m solving exercises on modeling, and in one exercise is given a sequence diagram, and I’d like to convert this diagram to Java code, considering that the execution starts from a method X of class…
-
-2
votes1
answer2077
viewsHow to open . html files in my application?
I’m making an application for Android and wanted to know how to open and display a file .html specific located on SD card directly in my application.
-
-2
votes4
answers2216
viewsIs there a problem using Java for commercial automation application in dektop? Or is it better to do it for the web using PHP?
I’m developing a project for desktop using Javafx and Postgresql, but I started reading about Java and found many cons about this programming language (slow, for example), so I’m thinking about…
-
-2
votes1
answer878
viewsJava command to add column in table
I need the code in Java on Android to sum the column of a given Sqlite table. I know the command is "Select sum(coluna) from tabela", but what I need to know is how to write this in Java to recover…
-
-2
votes1
answer1109
viewsReplace numbers with letters inside Arraylist
I’m creating a calculator where I want the numbers inside the ArrayList, are replaced by letters in textView. Example: 1 = To, 2 = B, etc.. With the code below, I got this by typing the numbers.…
-
-2
votes2
answers131
viewsWhen generating an image, I just want to visualize it and not save it
When using this code I save the image, but instead of saving I just want to visualize it. String key = "Lucão MC"; BufferedImage bufferedImage = ImageIO.read(new File("recibo.png")); Graphics…
-
-2
votes1
answer64
viewsFile. jar command console - client server program
I have developed a client server program, in which I have two Mains: one to run the server other to run several customers To extract the file . jar from ecplise I export runnable Jar File. I can run…
-
-2
votes1
answer563
viewsJDBC Callablestatement: Application hangs when calling Procedure
When I run a Procedure by the application it hangs, but in the bank performs normal. This is the way I use to call Procedure: public int incluir(TOCompra compra) { try { PreparedStatement ps =…
-
-2
votes1
answer72
viewsAndroid Studio App
I am developing an application that is a dictionary of chords for guitar. And as there are numerous chords, consequently I have numerous activities. The problem is that the application will be very,…
-
-2
votes1
answer204
viewsH2 database in Cronapp
I received the following message when trying to publish the application in Cronapp: "Your project uses an H2 database. Data persisted in this type of database may be lost due to distributed and…
-
-2
votes1
answer224
viewsHow to implement the method onBackPressed() in a class it inherits from Fragment, Causing it to return to the previous Fragment?
Segue um trecho de código para exemplificar meu problema: public class DashboardFragment extends Fragment{ ... } @Override public void onBackPressed(){ //Aqui volta para o Fragment anterior... }…
-
-2
votes1
answer83
viewsI cannot send values to Webservice . NET
This is a simple dollar conversion webservice: public class Callsoap { String resultado; String erro = null; public String Call (String ip, String porta, float n){ String SOAP_ADDRESS =…
-
-2
votes1
answer86
viewsResponsibility to keep information of items in a class
There’s an issue that I need to resolve urgently: Consider the code Venda.java. Remove the responsibility of keeping information from items sold in the class Venda, creating a new class ItemDeVenda.…
javaasked 9 years, 4 months ago Diogo Nazareno 1 -
-2
votes1
answer4897
viewsError cannot be resolved to a type
package livraria; public class CadastroDeLivro { public static void main(String[] args){ Livro livro = new livro (); livro.nome = "java prático"; livro.descricao = "novos recursos java"; livro.valor…
javaasked 8 years ago James G. Ramos 19 -
-2
votes1
answer125
viewsI need help in java
I am migrating a desktop application in Delphi to java, and in Delphi there is a class that persists in the database the values 00, 10, 20 and 30. I’m making a java Enum to persist the values. I…
-
-2
votes3
answers37
viewsDoubt about why it does not give nullpointexception
It’s a dumb doubt but why does this code work? public static void main(String[] args) throws ParseException { List<String> lista2 = teste(); System.out.println(lista2.toString()); } In this…
-
-2
votes1
answer108
viewsHow to run a task every month using Java
Hello, I would like to know how I can schedule a task to be executed all 1 day of the month. Thank you.
-
-2
votes1
answer74
viewsHow to trap a Jmenubar on top of the Jframe?
I forgot how to do this, I remember I have to put one BorderLayout(... NORTH);. How do I put a JMenuBar in a JFrame?
-
-2
votes1
answer114
viewsWhat are the reasons for migrating an application to a newer technology
I wonder what you think about that? What are the benefits? Thank you.
-
-2
votes1
answer208
viewsWhat are DAO, MB, TO, SERVICE, MODEL, CONVERTER and HELPER classes?
In the projects of the company in which I work I see several classes with these appointments, as I am beginner in programming I’m not sure what they mean. Could you clear me of that doubt ?
-
-2
votes1
answer135
viewsHow do I connect a Java application to the Mysql-in App on Azure?
How to connect an application via url to the Mysql database (Myslq-inApp) within Azure ? String urlLOCAL = "jdbc:mysql://localhost:3306/crudjsp"; String urlAzure = "jdbc:";…
-
-2
votes1
answer191
viewsJava WEB Paging
I have an application developed in Java Web and need to know what is the best way to paginate grid and whether, depending on how it was developed, I may have performance problems as a "Date"…
-
-2
votes1
answer360
viewsHow to add values from one array to another inversely?
Read a vector D of 10 elements. Create an array E, with all elements of D in the order inverse, ie, the last element will become the first, the penultimate will be the second and so from above.…
javaasked 7 years, 9 months ago Julio Souza 1 -
-2
votes1
answer331
viewsRobot Class with Variable
I have a code and need to write the value of a variable through the robot class, for example: int camera=2 Robot robot = new Robot(); robot.keyPress(KeyEvent.VK_C); robot.keyPress(KeyEvent.VK_A);…
javaasked 7 years, 9 months ago Lucas Moraes de Souza 37 -
-2
votes1
answer167
viewsHow to remove entity classes from Java Persistence mapped in a deleted project?
Database entity classes mapped in a previous project that was deleted continue to appear if I create a new project with the same name. How to Resolve with Netbeans 8.2 and Glassfish 4.1 Application…
-
-2
votes1
answer76
viewsHow to pick an item from a list and move with your finger to another position on Android?
I have a list and would like to move her first item to the last position dragging with your finger, someone could give some suggestion on how to do this on Android?
-
-2
votes1
answer85
viewsprint numbers using Tostring in java
Project scribble plus it didn’t print the numbers inside the []... package tostring2; import java.util.Arrays; public class ToString2 { public static String ToString2(int [] a) { int idades [] =…
-
-2
votes1
answer58
viewsList Database with Java or PHP
I wonder if there is any way for an application to show all databases of a connection? I currently use the command: select * from information_schema.TABLES;…
-
-2
votes2
answers479
viewsDoubt about method of sum
How to make a method that takes as parameter an integer vector, computes the sum and returns the sum? I tried to do so, but it did not work, the sum is not held. public static void main(String[]…
-
-2
votes1
answer143
viewsChange matrix structure
How to change the structure of an array? It can be using excel or via programming. I have already made my solution with Java but it was a lot :). Also not generic enough. Is there a Pattern design,…