Questions tagged as 'java'

1
answer

Doubt in Send SMS + GPS Coordinates

I'm trying to develop an app , where I need to get the GPS coordinates of the device's location to send them by SMS. What happens is that with a click on a button the logic will acquire the coordinates and send the SMS with them, with just...
asked by 29.09.2016 / 10:43
1
answer

Array to solve hidden phrase puzzle

"You have two arrays letras = ["m", "D", " ", "e", " ", "G", "v", "e", "i", "e", " ", "r", "S", "G", "D", "u"]; caminho = [ 12, 7, 11, 9, 8, 4, 15, 0, 2, 13, 14, 5, 10, 1, 3, 6]; There is a hidden phrase that you have to find out, but n...
asked by 04.03.2016 / 17:21
3
answers

how to select the entire row of a JTable using DefaultCellRenderer that changes the color of the line

Hello, I'm working with JTables, and in that JTable I needed to leave some lines in different colors, so I implemented the method class cellRenderModel extends DefaultTableCellRenderer { /** * */ private static final long serialVersionUID =...
asked by 23.05.2016 / 22:03
2
answers

Data does not persist in the txt file

Good morning, I have a question, I have this code, which is a contacts agenda and the data should be persisted in a txt file. What happens is that the program runs normally, but the data is not saved in that file, which I stored in a folder loca...
asked by 17.02.2016 / 12:00
1
answer

Problem when printing the contents of a vector

How to make a punctuation store for each answer. package modulo02; import java.util.Scanner; public class vetorGabarito { public static void main(String[] args) { int pontuacao = 0, n, i, j = 0; float s = 0, maiorMedia =...
asked by 16.02.2016 / 19:55
1
answer

Calculate delta value for assertEquals in JUnit

Greetings. What is the best way to calculate JUnit's assertEquals (message, expected, current, delta) delta value?     
asked by 18.04.2016 / 21:09
2
answers

Activate JButton from selection in JTable and remove the initial focus from the table

I have a window with a JTable , where only the selection of an entire row is valid, not just one field. The issue is that the window already opens with the first line selected, and I would like to disable it. In this same window I have...
asked by 24.04.2016 / 21:19
1
answer

Define which JFrames will be focused?

I need to keep a%% of focus in mind and not allow others to use it until I close this one. Every time you open a new frame the others below it must be inoperative. How can I do this?     
asked by 02.05.2016 / 15:01
1
answer

Convert String to Double while maintaining content

I need in Java to convert a String that has a binary value (Ex: "0111010") to a double . I tested: String teste = "101010101"; double number = Double.parseDouble(teste); System.out.println("The number is: " + number); But the o...
asked by 04.05.2016 / 05:47
1
answer

Pass array as parameter

I have a question regarding arrays . So I have the following code: public static void main(String[] args) { //Objetos..... ColeçãoCidades ListaCidades = new ColeçãoCidades(); //Adicionar regiões Scanner sc = new Scanner(Sys...
asked by 22.01.2016 / 13:17