Questions tagged as 'java'

1
answer

What is the difference between setSize and setBounds?

What is the difference in Java Swing between setSize and setBounds ?     
asked by 13.07.2015 / 02:26
2
answers

What is called a replaceable method in the constructor?

In a class that extends JFrame , I have some calls in the constructor, as can be seen below: public ListaDeOficiosUI() { try { this.oficioController = new OficioController(); this.initComponents();...
asked by 22.02.2016 / 11:57
1
answer

Popular via constructor with hibernate

I was reading this article link and talks about using builders for popular the objects and set aside some setters. How can I use constructors to populate an object with hibernate? At the time of picking up the form data and saving for example....
asked by 09.01.2016 / 00:15
1
answer

Calling an object while creating another object

I have a Person class and a Date class, the Person class creates a person the date class creates a date to use as the date of birth in the Person class, how is it that when creating a Person I create a date without having to use the code complet...
asked by 26.07.2016 / 23:43
3
answers

Sort threaded list with method O (n * log (n))

I need to sort a linked list (own implementation, without using Java API) with a sort method that has complexity O (n * log (n)). Searching for methods that satisfy the condition found quicksort, however, it assumes random access to the elements...
asked by 02.02.2016 / 01:55
1
answer

Client Threads Server

In the following class SocketServidor I send a single thread with the out and the in , but the class is supposed to be able to send two threads when it runs. You're supposed to do this:    The server should work in mult...
asked by 15.12.2015 / 15:37
1
answer

Entry not executed [duplicate]

I am a beginner in development and I am doing a job for college, but in my case of Creation of Cadastre the line 147 ( cadastro[1][codigo] = entrada.nextLine(); ) that would receive the data of the name of the client is not being execute...
asked by 30.11.2015 / 12:13
1
answer

What happens if a binary search does not find the element?

What happens if a binary search does not find the element? Does it enter loop ? What is the best way to end execution?     
asked by 23.11.2017 / 02:52
1
answer

What's wrong with this code?

My college teacher gave us this code and was asked what's wrong: public class Teste { private static Teste INSTANCE = null; public static Teste getInstance() { if ( INSTANCE == null ) { INSTANCE = new T...
asked by 14.02.2018 / 15:24
1
answer

What is the difference between revalidate () and repaint ()?

When working with swing, we usually call one of these methods after some change in screen components. But what's the difference between using repaint() or revalidate() ? In what situation should I use one or the other, or even t...
asked by 28.07.2017 / 16:18