Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question from NickyEng

 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all...

i'm new to Swing ...

i have a simple project of creating a simple application of bankAccounting.

i dont know which software to use to create a user friently interfrace. so far i have NetBeans installed in my laptop and is it suitable for using that?

and could anyone here tell me which book or which website appropriate to learn JFC???

the project require me to do it using Swing Components.

thanks in advance.
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java Tutorial (http://java.sun.com/tutorial) is quite good, although it can sometimes be a behind with some of the more recent changes to the Swing classes.
 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks.
 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JFrame problem

why i must put JLayeredPane on JFrame, then only can freely drag the button or any GUI items on NetBeans 4.0?

if i dont put it on JFrame, then no way i can drag the items freely on the design stage.

anyone may help?
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't recommend using any "gui-builders" just do the code by hand. It might seem tedious but you will learn more and you'll be able to understand/interact with the gui code better.

-Tad
 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah....you're right. i quit using netbeans, and code it with notepad....

i have a problem with a frame,and then menubar +menu.

i want something like, when i click on the menu item, then the container of frame will display the details.

sample:

Under "File" menu, has a menu item called "Create Account". when i click on the "create account", then a form will display on the frame , just under the menubar there.

what i should use ? JPanel? when i lick on the "Create account", i called addActionListener to perform the coding. and then create another class for displaying the form on the container of that frame? meaning everytime i click on menu item, i should create a new JPanel for each menu item and then add JPanel into the Container???
 
Tad Dicks
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now I didn't say stop using an IDE (though if your just starting out coding, I wouldn't use an IDE). If your doing a marginally complex task the IDE can be useful, just when you start using a gui to build the gui... I find it frustrating to get it to behave how you want.

-Tad
 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know i very dump at this.

could you help me, Tad?

i have the 2 file here, but i just cannot link them together.
when i click on the "Create" menu item under "Account" menu, it shows nothing on the container....i hope someone could help, because i tried whole day at home even try to find in java.sun.com/tutorial. i just can't figure it out.

i hope you guys can help me out, why can't display the stuff on container there...
p/s: if you edit the coding, please use comment line to state what you editted. thanks.

i will do my best to figure it out as i'm still newbie to Swing.



 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have fixed the problem with click and drag ...

actually set the Layout to null, then i can drap freely.

how stupid i was b4...

----

now left the problem with calling another class inside the actionPerformed method.....given 2 files above there, hope any one could help me...

---------------------------------------------------
morning about 2am ---> i finally can display the components of NewAccount.java in the container of BankFrame when i click on menu item called "Create New". probably its not a good practice but i finally figure it out on my own...since no one here to help me...

i put the doLayout() under the actionListenter method for action4Create....when i click on the "Create New"...i have to wait for 2 seconds, then only the components display on the container....i wonder why i have to wait for 2 seconds..

I dont create many posts in this section because i believe create for one post is enough and can continue with my doubtly question that i want to ask here....but i guess most of members here like to create a post with a question..and then have another question, create another post again....

me nothing against, but i'm just try to make the post that been created being used again with different questions and problem, so that the post in each section would be more less and more manageable???!?!?!?

guys, feel free to reply me .....thanks...

[ July 09, 2005: Message edited by: Nicky Eng ]
[ July 09, 2005: Message edited by: Nicky Eng ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic