Questions tagged as 'swing'

1
answer

How to remove the borders of a JFrame?

I'd like to remove the borders of a JFrame . I used setUndecorated(true) , however it completely removes and I would like to just leave the title bar of JFrame .     
asked by 29.07.2015 / 23:01
2
answers

What is the difference of use between KeyPressed and ActionPerformed?

I made tests to see the difference in use, and apparently both of them fire by pressing ENTER on the keyboard, as can be seen in the example below: import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.T...
asked by 30.08.2017 / 16:01
1
answer

Detect collision between corners of objects

I'm writing a game based on the breakout , but I can not think of a way to detect the collision between the corner of the ball area and the paddle, to be able to reverse the horizontal direction of the ball. In my class Ball , I have a...
asked by 09.05.2017 / 01:29
1
answer

How popular is a JTable with TableModel itself?

When you're messing with
asked by 04.04.2016 / 16:35
2
answers

Why is it not recommended to use DefaultTableModel?

I looked at some sites on how to fill a table in java, and many were suggested to avoid DefaultTableModel ? Why should you avoid using this class for cases of more complex objects? What does it imply in your use?     
asked by 18.01.2017 / 12:04
3
answers

Splash Screen loading with application

My application, when starting, does the first search in the database. Since I use Hibernate , this first connection is a bit more time consuming because it assembles all the database mapping. I'm thinking of adding a Splash Screen at the b...
asked by 24.07.2015 / 14:22
1
answer

Is it possible to put 3 colors on a button?

I need to divide the button into 3 "equal pieces" and each piece has a different color.  For example, a button with the colors Blue, Green and Red, each occupying 33.3% of space. How to do this?     
asked by 08.10.2017 / 04:41
2
answers

Calculator with Java Graphical Interface

I started working with the Swing framework, creating a calculator with JOptionPane , and I did it normally. Now I have the challenge of inserting the buttons in the calculator, the + , - , * and / problem is that I researched a lot an...
asked by 10.04.2014 / 07:36
1
answer

How do I make the JTable values the same as the ArrayListPessoa?

I have an example program that adds objects of the type of my class Pessoa to a JTable and also to ArrayList<T> , this program has three basic functionalities which are as follows: Add Change Delete See the pr...
asked by 18.10.2016 / 23:25
1
answer

What is Event-Dispatching Thread (EDT) in GUIs?

When you are learning how to construct graphical interfaces with swing / AWT , you hear a lot about the Event-Dispatching Thread (or EDT ). Although I already have a certain coexistence with
asked by 25.02.2016 / 14:15