I'm an SQL-beginner, I'm trying to write a simple application that allows me to manage my games library.
I tried doing various SELECT
from the db and all works properly.
Now the problem: when I click on btnAdd
I want to set my addGame
frame visible.
I tried this:
addGame.setVisible(true);
but when I set it visible, that's the result.
My Main Activity is this.
The Event bound to the button is:
private void btnAggiungiActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
addGame.pack();
//Dimension d = new Dimension(500, 100);
//addGame.setPreferredSize(d);
addGame.setVisible(true);
}
But with addGame.pack();
it only fits horizontal dimension. What's wrong?
It's hard to know what is specifically wrong without more code, preferably a small compilable program, but in general you should
setSize(...)
or setPreferredSize(...)
if possible.pack()
on the top-level window prior to calling setVisible(true)