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
votes1
answer90
viewsWhen creating an imageView and Textview via code how to remove via code?
Good create that way TextView textView = new TextView(this); textView.setText("Alguma coisa"); LinearLayout linear = (LinearLayout)findViewById(R.id.layoutVertical); linear.addView(textView); and to…
-
0
votes1
answer357
viewsFormatting of data output
So guys, I was "futucando" in java, but I came up with a question. How do I format a number that is in a method? For example: Code snippet: JOptionPane.showMessageDialog(null,brand+ "Saldo atual de…
javaasked 9 years, 4 months ago Daniel Santos 555 -
0
votes0
answers45
viewsIdeas to make a private history
try { Connection lig = DriverManager.getConnection( "jdbc:mysql://localhost/gym", "root", "0000"); PreparedStatement inst = lig .prepareStatement("SELECT ph.Produtos_idProdutos,…
-
0
votes1
answer38
viewserror: 'List ' is Abstract cannot be defined
I intend to use java with Android Studio to make a calculator, however, every time I click an add button to a list the values of these buttons. But having error in the list statement. someone can…
-
0
votes1
answer357
viewsHow to call a Service through another app?
I have two apps, the app 1 has several CRUD, the app 2 has several services and notifications. When trying to start Service by App 1, this is happening: java.lang.Securityexception: Not allowed to…
-
0
votes2
answers177
viewsImage problem
I made a small app to show my problem; whenever the player makes a sequence diagonally, wins, if no one does that, it’s a draw; don’t look at the fact that the second player will never win... I just…
-
0
votes1
answer335
viewsList by Mysql and Java foreign key
I’m trying to select the dvds that the partner registered but I’m not getting, I wonder if someone can help me, the result of my code returns like this Result: 1 - null - null - null - null - null -…
-
0
votes0
answers72
viewsHow to animate button before it is clicked
Here’s an animation I’m using in my project, only it gets animation as soon as it’s clicked: Button refresh = (Button)findViewById(R.id.refresh); refresh.setOnClickListener(new…
-
0
votes0
answers202
viewsCreate JAR with an enclosed txt
I have a program that saves contacts in a simple txt file, but when I want to run the jar on another machine (I use the jar for the netbeans package store), when I run on another machine it does not…
javaasked 9 years, 4 months ago Gustavo Rotondo 149 -
0
votes1
answer293
viewsReport title in Ireport
In the reports I create in Ireport, the title(title) area only comes out on the first page and the header(header) area comes out on all pages. How can I get the title out on all pages and the page…
javaasked 9 years, 4 months ago Rodrigo Lima 315 -
0
votes1
answer91
viewsError when injecting Service within a @Component
Set an example bean: @Component public class SimulationModelFactory { and within the class I am injecting my service example: @Autowired private SimulationFlowService simulationFlowService; Service…
-
0
votes1
answer230
viewsPrimepush Eventbus does not work and will give errors
I am started to learn in practice with Primefaces to give PUSH. Follow the link http://www.primefaces.org/showcase/push/chat.xhtml I implemented the codes following this link that I posted above,…
-
0
votes1
answer140
viewsSimulate different Timezone with Java
I developed a web application (with java) and there I have a business rule that needs to save the user’s subscription time. But I need to save 3 times: user’s local Timezone, global Timezone, and…
-
0
votes1
answer305
viewshow to import a play framework 2.5 project into the eclipse
Hello how could I import a lay framework project into the eclipse, in previous versions only the eclipse command within the project was enough but now the documentation is a little confused in this…
-
0
votes1
answer123
viewsBookmark does not redirect to login page
I followed the post about authentication and authorization in Demoiselle but I can’t redirect to the login page, follow files: frameworkdemoiselle.security.enabled=true…
-
0
votes2
answers332
viewsJSP to import all acquisitions from a directory
It is possible import all files in a directory with only one call working with JSP ? Today I have the following: <script src="../resources/js/angular/directive/layout/mensagem.js"…
-
0
votes2
answers109
viewsNullpointerexception on Android
I have a problem listing the photos in the folder DCIM on Android. It gives loop error for, launching a java.lang.NullPointerException? What can it be? See the code that I get the information from…
-
0
votes0
answers27
viewsIs it possible to develop Aglets-like agents using EJB 3.0?
A few years ago I worked a master’s project of analysis and maintenance of networks infrastructure using Agentes Móvel based on Aglets. Today I am designing a new system that will need agents able…
-
0
votes0
answers165
viewsEncoding problems in java
I have a classic encoding problem, I’ve done several tests, but nothing solved. The problem only occurs with data brought from the database in Sql Server, with the text fixed on the screen ta…
-
0
votes1
answer988
viewsHow to get URL value
Help me... I’m stuck on the following question... I need to get the id of the user that comes through the URL parameter, as below: localhost:8080/Sgc/pages/generationNew.xhtml? id=3 But I don’t know…
javaasked 9 years, 4 months ago Marquin Ferreira 362 -
0
votes1
answer1058
viewsCreate an Upgrade System - Java
Good afternoon, you guys, I developed a system where I depend on staying to do upgrades and maintenance on the system. But I’m having trouble distributing the updates because it is Desktop system.…
-
0
votes1
answer67
viewsDoes closing Datainputstream always close Inputstream?
I need to temporarily use one Datainputstream with an inputStream of a socket. I need to use close-up on Datainputstream? And if I use I’d be closing the socket inputStream too ?…
-
0
votes1
answer119
viewsGenerate Url through form
I have the following url: www.teste.com/username=xxxx I have to type the name of Usario in xxxx, I am creating a form in html with the username field, I want that when the user type his name in this…
-
0
votes2
answers509
views -
0
votes1
answer1194
viewsPrevent a second click on the same button
In this memory game, when I click the first button and then the second button, everything happens according to the algorithm, but when I click two clicks on the first button, there is a problem... I…
-
0
votes1
answer53
viewsNull Pointer Exception Javafx
what’s wrong with the following excerpt from my code ? public static void retorna(BufferedImage bufImage) throws IOException { // String file = new String("test.png"); // setTfFoto(bufImage); Image…
javaasked 9 years, 3 months ago Alex Sandro 37 -
0
votes0
answers115
viewsdlls convention cdecl and stdcall
There is a difference in DLL calls with cdecl and stdcall conventions ? Or I program the same way for both conventions? I am using Java.
javaasked 9 years, 3 months ago Rodrigo Lima 315 -
0
votes0
answers240
viewsHow to force sign in with Android?
I’m having trouble developing a piece of my app. Come on. First I need to click on a button and access a certain link and then the application return me a PDF. This already exists through the…
-
0
votes1
answer86
viewsError copying data from one table to another
Good afternoon Guys, I’m making an application that makes a Dvs loan request, I managed to make the application to enter the reservation, now I need to make the dvd owner confirm the rental and copy…
-
0
votes1
answer424
viewsEclipse and Selenium - Transforming . JAVA into . EXE or . BAT
I’m using Eclipse and the Selenium framework to create automated web page opening routines and execute commands (link clicks, field fill, site change, etc). I’ve managed to create some test routines…
-
0
votes1
answer418
viewsDo not save photo to Android folder
I’m having a problem to save the photo in the Android images folder. Simply it does not save the photo, IE, nor runs the TRY of ActivityResult. He even puts it on ImageView: // CAPTURAR FOTO BOTÃO…
-
0
votes1
answer160
viewsHow can I select this Datatable?
I created a datatable of variable columns whose collection takes place from a list of objects with several different attributes. In detail, I have an Avaliaprojeto class, which has a Projeto…
-
0
votes0
answers51
viewsGrab an AWS image and attach it to the email?
Is it possible to 'uple' an image in aws, and then attach it to an email? I thought of two things: If there is a way to recover the file directly from aws server ( as if it were my pc, for example,…
-
0
votes1
answer683
viewsProblem reading property file
I created a propertie file for the database to read this file from there but the console presents me the following error: Erronull\properties\conexao.propertie (O sistema não pode encontrar o…
-
0
votes0
answers58
viewsSmallest JRE(jvm) possible
I am creating a Java application and need to put the JRE together, and some wrapper, or even an installer. Is there any program that does this, with the SMALLEST jre possible already included?…
javaasked 9 years, 3 months ago Rodrigo Santiago 1,822 -
0
votes1
answer460
viewsDouble check - Java
I’m not getting this check I’ve tried everything, but always gives me this mistake: java.lang.Numberformatexception: Invalid double: "" If anyone can help, thank you. package com.calculadora; import…
-
0
votes0
answers383
views@Retryable and @Async com spring
It is possible to create an asynchronous method that can be tried again if some exception occurs with spring? @Retryable @Async public void myMethod() throws Exception { // Do some stuff }…
-
0
votes0
answers51
viewsHow do I inform if the user already exists when I press the save button?
How do I press save button and inform if user already exists. public void salvar(){ String comando = ""; if (this.getId() == -1){ comando = String.format("INSERT INTO cadastro (nomedousuario, senha)…
-
0
votes2
answers763
viewsIs it possible to compare items from two lists and if there is similarity between items do not display this item in a datatable?
I have a list that is populated by data from an xml file and another list that is returned from a query in the database. I wonder if it is possible to compare an existing code in these 2 lists. If…
-
0
votes1
answer99
viewsAssociate values of a dropdown with a specific column in the BD for query
I have a filter on my site that is in the image below: The real goal of the same is to "search" travel destinations (Ex:. Paris, Barcelona, Bahia etc...) and present on the screen the same. I have…
-
0
votes2
answers732
viewsREST in Java Spring project does not work
I created a project in the Spring Tool Suite to test a web and REST system, in the same project, worked well to create a static html page and load in the browser, but I created a java class for GET…
-
0
votes1
answer78
viewsUse of the Big Integer class to build an MD5 hash
I found in another post right here in the OS the following example of code to generate a hash through MD5: String message = "teste1234"; byte[] hash =…
-
0
votes2
answers1140
viewsMonitor if REST services are online
Does anyone know what would be an interesting tool to monitor whether services are online or not ?
-
0
votes1
answer471
viewsHandling Hours with Joda Time
String tempo1 = "01:30:30"; String tempo2 = "24:25:10"; SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); try { Date date1 = (Date)sdf.parse(tempo1); Date date2 = (Date)sdf.parse(tempo2);…
-
0
votes1
answer194
viewsMake a table condition type in Mysql
Hello, I am setting up a hotel bank in Mysql and I would like to know how to add a condition for date and time of entry (checkin) and date and time of departure(checkout) specific for there to be no…
-
0
votes0
answers75
viewsIf I’m going to create a J2EE application in Eclipse, should I download the Javaee version?
What is the most suitable version of Eclipse to work with J2EE?
-
0
votes1
answer913
viewsPlay and Pause script in HTML5 video does not work
I found this script here on the site. it serves to give play and pause in HTML 5 videos. But it seems to have an error, the click and pause effect only works if you have 1 video on the page, if you…
-
0
votes0
answers59
viewsUrlrewriterfilter problem load css and js
I am using taglib as a template to load header, body and footer on my jsp pages. For friendly Urls I use Urlrewritefilter. The problem is when I pass parameters in the URL friendly as it does not…
-
0
votes0
answers41
viewsQuestions with the Jsobject class
"To pass an applet value to HTML, I needed to create an object from the Netscape.javascript.Jsobject class." My question is this Jsobject class is working in current browsers? I made a code here now…
-
0
votes1
answer490
viewsError generating Report in Jasper Ireports
I followed a blog on the web that teaches how to generate the reports, but I come across a situation that I can not solve. In case I have the following codes: Main java. public class Main { /** *…