Questions tagged as 'java'

1
answer

How to create a new window for each click button? [closed]

Hello, I'm a beginner in programming for android, and I'm making an application (work from the TI course). It is as follows: The first Activity has 12 buttons with background of "tables", representing the tables of a restaurant. When clicking...
asked by 21.11.2015 / 15:47
2
answers

Time comparison

Please, I am trying to compare hours (type Open Now / Closed Now). But I can not. To save the current time, I'm using: object.put("h11", h11.getText().toString()); object.put("h22", h22.getText().toString())...
asked by 24.11.2016 / 00:01
2
answers

JSP - Use request in a method

I'm trying to use a request within a method as follows: <%! public void method() { RequestDispatcher disp = request.getRequestDispatcher("t2.jsp"); disp.forward(request, response); }; %> But...
asked by 28.11.2016 / 15:39
1
answer

What is this? private ListMapString, Object expenditures;

A list of maps? I seriously was scared of it. I've never seen this in my life ... private List<Map<String, Object>> listarGastos() { gastos = new ArrayList<Map<String, Object>>(); Map<String, Object> item = ne...
asked by 28.11.2016 / 05:27
1
answer

Update a Jtable that is in a JFrame from a JDialog

What I'm doing is a little longer, so I'll shorten the problem with a more objective example: I have a registration form and created a modal Jdialog with the fields that I want to search. When I search in JDialog I would like to filter the in...
asked by 02.02.2016 / 12:28
3
answers

How to set index when inserting item in JComboBox?

I wonder if anyone could help me. I'm trying to add items to a JComboBox : Pessoa carlos = new Pessoa(12, "Carlos" , 0.0f); jComboBoxF.addItem(carlos.getNome()); Pessoa maria = new Pessoa(23, "Maria" ,0.0f); jComboBoxF.addItem(maria.getN...
asked by 23.07.2015 / 20:31
1
answer

JavaDB generating sequence of ids with 3 digits

I'm trying to learn Hibernate with JPA, I did a test to write to the JavaDB database and realized that the id autoincrement instead of generating an initial sequence of one digit (1,2,3,4 ...) is generating a sequence which starts at 1 and jumps...
asked by 17.06.2016 / 05:10
1
answer

How to get quantity of items from an ArrayList?

I'm trying to count how many items it contains in a ArrayList , I already have something ready: private int quantidadeN = listaNotificacaos.size(); It should save the amount inside the variable quantidadeN , but when I play the...
asked by 20.06.2016 / 20:47
2
answers

How to print a dotted decimal number, not comma?

If I do: float a=5; System.out.printf("%d", a); The output of it will be:    5,000000 How do I print 5.000000 ? That is, I want to replace the comma by the dot.     
asked by 23.06.2016 / 02:40
1
answer

Why should E.printStackTrace be removed?

I use Try catch as follows: try{ //meu código } catch(Exception E) { E.printStackTrace(); } Using netbeans IDE, it shows a hint, called "Print Stack Trace", when I click on it, it says ("Throwable.printStackTrace should be removed!)...
asked by 24.06.2016 / 14:27