Questions tagged as 'java'

2
answers

Because the System.out.print.ln of this if does not play

Can someone tell me why my code does not execute the System.out.println(""); of the end if if it returns true . public static void tabelear (int tabela[][]){ for(int linha=0;linha < tabela.length; linha++){...
asked by 08.06.2017 / 20:25
1
answer

What is the best way to eliminate spaces and points? [closed]

This is my code, but the output does not match what I want and you are not separating the space or deleting the dots of all lines in the file. BufferedReader inf = null; String line; String ficheiro; try { inf = new BufferedReader(new Fil...
asked by 27.06.2017 / 18:29
1
answer

Apply focus to component

I have a component that is a JPanel that contains two JTextFields , I wanted to be able to apply borders and backgrounds only to the JTextFields , without applying it in the panel. I treat everything on the main screen to b...
asked by 21.06.2017 / 05:11
1
answer

How to get the date of a server instead of local server?

I made the following license form con.executaSql("select *from vencimento"); con.rs.last(); SimpleDateFormat df = new SimpleDateFormat("ddMMyyyy"); Date hoje = new Date(); String dataAtual = df.format(hoje); String dataSist...
asked by 17.11.2016 / 01:15
2
answers

File still in use by Java / How to close file connection

Problem: Codetodemonstratetheproblem:importjava.io.File;importjava.io.FileInputStream;importjava.io.FileNotFoundException;importjava.util.logging.Level;importjava.util.logging.Logger;importjavafx.application.Application;importjavafx.event.Ac...
asked by 02.02.2018 / 13:33
1
answer

Show a string in an AlertDialog

Well, I'm learning android, I do not know much. In this application, so far I just want to display the value of "name" in the .setMessage of AlertDialog, and I'm not sure how I do it, grateful now! NOTE: When I run the app on my device, "Your...
asked by 08.07.2017 / 17:24
1
answer

Creating component dynamically

I made a method whose goal is to add a quantity of checkBoxes according to the value of a variable that I'm going to receive. I wanted it to stay inside a scrollPane so it would not take up more space than I set. What I could not do was make...
asked by 08.07.2017 / 03:17
2
answers

Make a parser in a txt file

Good morning, I created a * .txt file with certain paths, now I need to put those paths inside variables to call them in the application. I thought about using a parser to get this information, but I did not get any examples. If you can hel...
asked by 08.07.2016 / 16:26
1
answer

Translate date format from English to Portuguese

I'm converting a String to Data SimpleDateFormat dateFormat = new SimpleDateFormat("EE MMM dd HH:mm:ss z yyyy", Locale.ENGLISH); Date convertDate = new Date(); String dd = c.getString(c.g...
asked by 25.10.2016 / 20:03
2
answers

How to transform a system out to string?

I want to display a message on the device screen. The message is in System.out.println("Mensagem ") ; How do I make a string and print on the screen using a textView ?     
asked by 26.10.2016 / 03:05