Questions tagged as 'java'

1
answer

How does the Java compiler work?

Why does the compiler of Java not be able to guess which type of object to return on the line that will cause compilation error in this program? import java.util.*; class Teste { public static void main(String[] args) { //...
asked by 24.04.2015 / 03:00
1
answer

Return values for all months of the year by drawing per month

I have the following SELECT: SELECT coalesce(sum(vs.total), 0) FROM tabela_exemplo t WHERE extract(year from t.data_entrada) = extract(year from current_date) GROUP BY extract(month from t.data_entrada); What returns the following result:...
asked by 20.10.2015 / 21:13
1
answer

Spacing with GridBagLayout

I'm putting together a test layout with GribBagLayout, but I'm having difficulty positioning the elements. The frame has two panel . I want the items on the left panel (Label 1, text 1 ...) to have a small spacing from the left and Label 1 also...
asked by 25.10.2015 / 02:20
1
answer

How to put a JLabel above the buttons in a JDialog?

I would like to put a label in a JDialog, but above the buttons there. How can I do this? I get all the components online: private void jFormattedNumMatriculaComercialMouseClicked(java.awt.event.MouseEvent evt) {...
asked by 07.11.2014 / 13:47
1
answer

How to include .jsp file in the solution?

I'm developing Java web applications using JSP's. I have a file called header.jsp , which contains links to CSS files and other things that are important to my system that is in the root directory. I have a folder that has other .jsp...
asked by 11.11.2014 / 04:24
1
answer

Java / SqlServer transaction divided into several methods

I have a method that executes multiple Prepared Statements , only two of them in methods of other classes. In my method, I have the object connection , and if you want to start a transaction, I have to do: connection.setAutoCommit(...
asked by 07.11.2014 / 10:22
1
answer

Recursive Methods VS Iteration [duplicate]

What is the difference between recursive methods and iteration and what are the advantages of using the two approaches in a java program?     
asked by 13.11.2014 / 19:59
2
answers

Java ScheduleExpression

I am developing a Nobreaks Monitoring Software, I am using ScheduleExpression that runs every 5 seconds, it follows code: @PostConstruct public void agendarMonitoramento(){ System.out.println("=====================================...
asked by 17.11.2014 / 13:24
1
answer

How to deserialize JSON using Gson with generic list?

I need to deserialize JSON to a generic list, but I'm having an error that I believe to be in the conversion: Method call: AtualizarJSON at = (AtualizarJSON) DeserializaConsulta(AtualizarJSON.class, resultadoJSON); Method: private <...
asked by 18.11.2014 / 00:48
1
answer

Spinner with states and cities?

How does a spinner work with states and cities in Brazil? When you click on the state, list the cities? How to do this? A bank with everything registered? SQLite? Do I need a ready-made model for states and cities?     
asked by 01.12.2014 / 03:01