The Artima Developer Community
Sponsored Link

Java Answers Forum
Interface transitions

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jason

Posts: 1
Nickname: jasond
Registered: Jun, 2002

Interface transitions Posted: Jun 7, 2002 3:19 AM
Reply to this message Reply
Advertisement
Hi all,

I'm new to this forum and am hoing that I can gain valuable experience from the experienced as well as provide assistance to those who need it.

I'm trying to design a GUI that allows a user to move through different pages. Eg when he clicks 'next', another JPanel must replace the present one.

Heres some psuedo..

constructor is called
JPanel first, second, buttons created;
Container cp = getContentPane();
call method first()
if next is clicked call second();

cp.add(buttons);
cp.add(first);
pack();
setLocation(200,200);
setVis ible(true);

public void first() {
cp.remove(second);
cp.add(first);
pack();
return;
}

public void second() {
cp.remove(first);
cp.add(second);
pack();
return;
}

This looks pretty raw I know, but should give the basic idea of what i'm trying to do.
The problem comes when I click 'next',
the first screen dissapears, but the 2nd screen is blank, as if the JPanel hasnt been added.
I tried repaint(), but no luck.

Anyone got any suggestions ?
Thanks
Jason

Topic: FTP login works in Windows but not in UNIX Previous Topic   Next Topic Topic: Interactivity

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use