Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

Nuno Smith

Greenhorn
+ Follow
since Apr 25, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nuno Smith

Thanks for your replies . I will leave this topic open, as I will certainly have more Swing questions while coding the Sudoku.
12 years ago
Olivier Legat, thanks for your reply. That fixed the problem.

I still have some questions I would like you to answer me, if possible:

1. Why should setVisible be called at the end of the building method? Why did this fixed the problem?
2. Is it possible to make a non re-sizable frame? How?
3. I read in some official java sun tutorials, that generally, instead of calling setSize one should call pack(). However, when I do this I don't even see any text fields? Why?
4. Is it good practice to add the components to the its parent component and only then add the parent to the frame? Or can I do it in whatever order I want?
5. I have now uncommented the code that creates and adds the buttons to the frame, but, now, they don't appear in the screen. What am I doing wrong?

Thanks.
12 years ago
Hi all. I have recently started out Java and have been experimenting with Swing. However, I have come across this problem I can't figure out.

The code below gives different results in every run. Sometimes gives 3 text fields, others 4, 5, 6, etc.. It's almost random. Why does this happen?

I know I could use the editor GUI for this, but since I will have to generate 81 text fields I think it's best to learn how to do it programatically.



Any help is greatly appreciated.
12 years ago