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
answers164
viewsApp Automaticao Residencial
I’m creating a home automation app, in it I have the main screen that when selecting the desired category it opens a second screen with the commands (example category lights, it opens the commands…
-
1
votes0
answers68
viewsArchive Template for Netbeans
With Maven Archetype you can create project templates. And for archive template there is something similar? I would like to create a file creation wizard. Something like creating Servlets, where the…
-
1
votes2
answers1021
viewsDisplay all directories and files contained in them
I’m trying to mount a file tree where in addition to displaying the computer directories is displayed also your files. The code I made below is listing only the specified directory, in case the C:\.…
-
1
votes1
answer1835
viewsFormat layout for Zebra printer printing
I was able to print on a Zebra RW 420 printer, but I don’t know how to format the texts, I looked at the documentation to send the data to the printer and noticed the following: String cpclData = "!…
-
1
votes1
answer1512
viewsSelenium/Webdriver code to run after reading spreadsheet with Apache Poi
My test code using Selenium/Webdriver stops running after reading Apache Poi data. Can anyone tell me why? //poi WebElement searchbox = driver.findElement(By.name("simcard")); try { FileInputStream…
-
1
votes1
answer5215
viewsHow to click on the Listview item and call another screen?
I created a listview where it shows my registered items, as I do so when clicking on the desired item it opens a new screen with the description and details of the item? Class where displays my…
-
1
votes0
answers138
viewsError of Session in Java
I have the following methods : public void delete(Class c, int id) throws SQLException { Session session = sessionFactory.openSession(); Transaction tx = session.beginTransaction(); try{ Object ob =…
-
1
votes1
answer59
viewsNotifier of any event that the user performs in the system
I am using the Spring Framework for java and would like to create can create a kind of warning, <scan>, which shows in the table that a new line has been added (this line comes from the…
java web-application jsp spring-mvc spring-securityasked 8 years, 10 months ago Vinicius Duarte 115 -
1
votes0
answers31
viewsHow does the eclipse create a project?
I want to understand how the eclipse generates a project Which folders are required within the project directory ? eg: src/ What files does it generate to identify which is a project eclipse ? How…
-
1
votes0
answers52
viewsReturn with "|"
public static final int corCombina(int cor1, int cor2) { if (!corValida(cor1)) return -1; //Se a cor1 não é válida, retorne -1... if (!corValida(cor2)) return -1; //Se a cor2 não é válida, retorne…
javaasked 8 years, 10 months ago ShadowCodes 21 -
1
votes2
answers895
viewsCalculation of the Z value of the normal distribution
Good morning, I’m having a problem calculating the Z-value in the normal distribution. Also the calculation of t and sigma t constants are giving me 0, which is impossible. I’ll put the code and…
-
1
votes2
answers578
viewsWhy can’t I upload static data to the JSF datatable?
This is my class: package com.algaworks.pedidovenda.controller; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.faces.bean.ManagedBean; import…
-
1
votes0
answers213
viewsGroup recyclerview items by the.time item similar to facebook messenger
I’m trying to create behavior similar to what happens in Facebook Messenger, when sending several consecutive messages, for this I created several background drawables with border radius to be…
-
1
votes1
answer361
viewsSpring-Data JPA and Audit updated by @Modifying
It is possible to audit an update operation with Spring-Data Auditing using the update via annotations @Query and @Modifying instead of using the method save()?…
-
1
votes1
answer1222
viewsHow to sign file . jar with A3 certificate?
I’m developing a web project and I needed to develop a applet with the language Java for some functions. The browsers are complaining about the security issue and, researching, I found that I have…
-
1
votes0
answers47
viewsApp turns white and suspending all threads on Logcat
Guys, I’m studying Android on my own and in my studies I created a hangman game, only when I replace the word to be discovered in String "word" with a word that contains repeated letters like…
-
1
votes0
answers86
viewsHow do I make one image not run over another?
All right? I have a code where I can move several images with the mouse but when dragging an image it goes over the others. I want to move it without going over. Follows the codes: package…
-
1
votes0
answers45
viewsJava application running as Windows service
I need to develop a Java application that should run in company branches as a Windows service. The scenario is as follows: I need to get some information from the database of a third-party software…
-
1
votes1
answer961
viewsHow to update Jtable used data from a database?
I created in Netbeans a customer registration and movie registration system (simulating a video rental company). I have 3 Java files: Video Rental (main), Client and Movie. In Client and Film, I…
-
1
votes0
answers121
viewsdetecting movements using onTouchEvent
I found this method on the internet to detect movement, but I would like when it moves right it executes a command (example changes button color), but I’m having trouble implementing this code if…
-
1
votes0
answers108
viewsProblems generating JSON with JAVA
I’m having trouble generating this json { "receita": [{ "specialtys": [{ "date": "27/01/2016 00:00:00", "itemSpecialtys": [{ "specialtyId": 1, "specialtyName": "Tabelionato de Notas", "receitas": [{…
-
1
votes0
answers61
viewsLoggerfields for Syslog (write priority and stack trace)
Log4j can send logs to Papertrail using a syslog appender (documentation): log4j.appender.syslog=org.apache.log4j.net.SyslogAppender log4j.appender.syslog.Facility=LOCAL7…
-
1
votes0
answers846
viewsJasper report is not generated on production server
a problem in the use of JasperReports. I created a class to generate the reports, from some parameters. It inside the Eclipse generates normally, but when I export the WAR and put into production,…
-
1
votes1
answer2956
viewsHow to check if a file already exists and overwrite it in Java?
Hello. I am developing a system where in a certain situation, I must save a file with a picture extension created by me. If the file already exists, I check with the user if he wants to overwrite…
-
1
votes1
answer270
viewsContent of one matrix receiving from another
Main matrix: public static String [][] matrizPrincipal(){ String [] [] matriz = new String [2] [6]; matriz[0][0] = "Robin Arryn"; matriz[0][1] = "Lino Facioli"; matriz[0][2] = "145"; matriz[0][3] =…
-
1
votes1
answer189
viewsHow to read a return Map<String, String> Java in javascript?
When making a request to a java control that returns a key map and value "String": @ControllerSupport public Map< String, String > teste() { Map< String, String > teste = new HashMap<…
-
1
votes1
answer2026
viewsWhat is the use of get and set methods in a String array?
I am not able to fill them and show the result on the screen with the use of these methods. To show what you have in the array I used another method the listArray and to insert data in the array I…
-
1
votes1
answer72
viewsProblem with database insertion
I have in my system the following code: public int insert_dependente(Dependente dependente) { ResultSet r; int result = 0; if (!(dependente == null)) { try { Connection conn = new…
-
1
votes0
answers50
viewseclipse database connection
btnLogIn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { Connection lig = DriverManager.getConnection( "jdbc:mysql://localhost/gym", "root", "");…
-
1
votes1
answer1131
viewsWhat’s left to configure with Spring boot?
The settings I use with spring are based on Java class, as in this example https://github.com/matheussilvasantos/autocomplete. If this project used the spring boot, what settings would still be…
-
1
votes1
answer163
viewsUsing Connection is polymorphism?
Connection connection; connection = new ConnectionFactory().getConnection(); I can say that doing this is polymorphism? The Connection receive the class connection ConnectionFactory.…
-
1
votes1
answer228
viewsHow to receive a value and store it in the position indicated by the user in an array of arrays (matrix)?
I did it this way: int matriz[][] = new int[numLinhas][numColunas]; //FOR PARA RECEBER OS VALORES E POSIÇÕES INFORMADAS PELO USUÁRIO for(int x=0; x<numLinhas; x++) { valor =…
-
1
votes0
answers102
viewsI’m having trouble persisting the data in the BD
I am connected to the postgresql database, I put the postgresql-9.4-1201.jdbc4.jar driver. When I click to register this window appears this is not listing or persisting. The problem is that no…
-
1
votes0
answers99
viewsA3 Digital Certification
I have recently been engaged to develop an application that you should use Certificação Digital A3 using a token. I have no experience with digital certifications and wanted to know how to start…
-
1
votes2
answers960
viewsTechnologies for Instant Messaging App
I want to develop an Android app(native) instant messaging as Whatsapp for my TCC, I would like to know what technologies for the Java platform offer support for this type of communication, some API…
-
1
votes1
answer401
viewsHow to understand the error message?
How to understand this error message? mai 20, 2015 8:25:59 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute ADVERTÊNCIA: /pages/produtoCadastro.xhtml @80,49…
-
1
votes1
answer104
viewsMethods to test Spring application are not found
I am following the following article: Introduction To Spring MVC Test Framework I have the following code: this.mockMvc.perform(get("/product/1")) .andExpect(status().isOk().…
-
1
votes0
answers919
viewsConsuming webservice Soap on android
I’m trying to consume a webservice but I’m in trouble. I already tested in soapUI and the webservice is perfect, the problem is time to consume in Android Studio. I got the following wsdl: This XML…
-
1
votes1
answer90
viewsCreate new matrix with content from another matrix
Main matrix: public static String [][] matrizPrincipal(){ String [] [] matriz = new String [2] [6]; matriz[0][0] = "Robin Arryn"; matriz[0][1] = "Lino Facioli"; matriz[0][2] = "145"; matriz[0][3] =…
-
1
votes2
answers380
viewsError in getWritableDatabase()
I’m trying to open the database to enter values in the class CadSalario, but I’m making a mistake in dbHelper.getWritableDatabase(); and I looked on the net and I have to call a context, someone can…
-
1
votes2
answers1023
viewsHow to hide text that appears after my domain in a URL?
I have a Java application using Spring MVC. Suppose my application has the domain www.meusistema.com.br As the user navigates, other urls are generated, example: www.meusistema.com.br/acessarConta…
-
1
votes1
answer7492
viewsHow to exclude an element from a vector in Java
I’m having trouble in the case 5, where I have to delete vector elements, can anyone help? I’m starting programming now. import javax.swing.*; public class Gere { public static void main (String []…
-
1
votes1
answer1153
viewsHow to create a Textview and Imageview via code?
I would like to know how it creates via code a TextView and a ImageView and destroy it via code.
-
1
votes0
answers159
viewsProblems with user login
Today, I make my connection to database using jpa. In my persistence I have 2 PU , one is to connect in my "Manager", which is where my addresses of the database are, and the other is to connect in…
-
1
votes1
answer49
viewsProblems with the Hibernate update
I’m having some unforeseen events with Hibernate in my application. I wonder if the implementations of annotations made in class java are taken to the database or processed only within the system,…
-
1
votes1
answer1133
viewsError in connection with the database. Java + Workbench
Error in connection with bank. Can anyone help me? package conexaoprojeto; import java.sql.*; import javax.swing.JOptionPane; public class ConexaoProjeto { private final String Driver =…
-
1
votes0
answers270
viewsLibrary problems on the Jboss server
I’m having a strange problem, my application works perfectly in Netbeans but when climbing to the server the same is giving error, says that it does not find some libraries. I found it very strange…
-
1
votes0
answers91
viewsHow to configure DB via an environment variable?
I have a multi-client JSP application. Currently the database configuration is in a file variable.propriet, and obtain through the method private static String getUrlBanco() { ResourceBundle b =…
-
1
votes2
answers319
viewsHow to read multiple Soapobject from a Webservice?
I am trying to consume a Web Service in Java using Ksoap 2 in version 3.4.0. When I do a search without parameters it returns the expected result but when I do a search passing a parameter…
-
1
votes1
answer2928
viewsNo Qualifying bean of type found for dependency
I searched Stackoverflow and Stackoverflow in Portuguese but nothing guaranteed the solution to the problem. I have been through this problem several times but at the moment I do not find the…
java spring maven tomcat dependency-injectionasked 8 years, 9 months ago Giancarlo Abel Giulian 3,999