Questions tagged as 'java'

2
answers

Check current smartphone time

I always want to check the current time on my device and display a notification. But using this code, I can only get the time I open the app How can I do this background check, and when it arrives at the specified time the app sends me the no...
asked by 31.05.2016 / 01:57
1
answer

How to return the declaration of an attribute in a JLabel?

I'm a beginner in programming, my question is:   - I created a public static final double Preco_Gasolina = 3.85 attribute in a class A.  - I want to return the value of Preco_Gasolina = 3.85 in a JLabel in class B. This is po...
asked by 17.04.2016 / 22:53
2
answers

How to change settings of the persistence.xml file through an external file?

I wanted to know how to change the configuration of the persistence.xml file from an external file. I'm using JSF + JPA. I want to do this not to leave this setting stuck in the source code. Does anyone give me a help?     
asked by 04.08.2016 / 15:02
1
answer

Javascript on page JSF - PrimeFace

HTML code - JAVASCRIPT It read a txt file from the computer and puts its value into an html input <input type="file" id="files" name="files[]" multiple /> <input type="text" required name="txtstart" style="width:150px" value=""> &...
asked by 09.03.2016 / 04:02
1
answer

Delete file * .pdf

I am making an application that opens a * .pdf file, so I apply a filter on it, however I am having a hard time deleting this file once it has already been read. I did the same with a * .txt file and it worked fine. If you have any idea what mig...
asked by 06.07.2016 / 22:58
1
answer

Time Formatting

I'm doing an application that divided a String to write the same in the time format. But if I put 102330 instead of returning me 10:23:30 it brings me 1:02:33 being that if I put 112126 it formats correctly for 11:21:26. If anyone can help me, t...
asked by 05.07.2016 / 20:12
1
answer

Execute an action when a button is clicked for the first time and another one otherwise

I would like to know how to do an if when the button is clicked. For example: private void btnEditarActionPerformed(java.awt.event.ActionEvent evt) { ProdutosDAO produtoDAO = new ProdutosDAO();...
asked by 07.07.2016 / 01:34
1
answer

Close DataInputStream always closes InputStream?

I need to temporarily use a DataInputStream with an inputStream of a socket. Do I need to use close in DataInputStream ? And if I use it would I be closing the inputStream of the socket as well?     
asked by 15.03.2016 / 19:40
1
answer

Result of JAVA Android function

I have a very simple question for anyone who already understands Java but it's breaking my head. Being direct, I have my MainActivity and a layout with two EditText's and a button, and a SystemHttp Class. I wanted when I clicked on the button,...
asked by 16.03.2016 / 20:04
1
answer

List Adapter Duplicating Positions in ListView

I have a class named "AdapterListParts" which extends the BaseAdapter class and in it I inflate a layout that contains a CheckBox and an ImageView. AdapterList Players class public class AdapterListJogadores extends BaseAdapter { priv...
asked by 11.02.2016 / 22:27