"Next Page" function?

How to create a "Next Page" Function?

Page 1 of 1

5 Replies - 2021 Views - Last Post: 20 November 2008 - 10:33 AM Rate Topic: -----

#1 mumeisyuu  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 55
  • Joined: 03-October 08

"Next Page" function?

Post icon  Posted 19 November 2008 - 10:08 AM

I don't know how to put this, but...
lets say~ I've built an Applet like the one shown below:
Posted Image

Then, after inputting the name and pressed "Next" or Enter,
it then shows a page like this:
Posted Image

So how can I transfer the UI from 1st to 2nd?
Can it be done with in Java?
Within same class?
Without needing to open a new webpage?

I tried to use removeAll(); but the whole applet then just got stuck...
Anyone can help~? Thanks for helping >"<

Is This A Good Question/Topic? 0
  • +

Replies To: "Next Page" function?

#2 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: "Next Page" function?

Posted 19 November 2008 - 11:12 AM

well it will be based on how you are creating the graphics, but in general you can remove and add panels as needed, so you could construct the new panel when clicking the next button and set it on the frame.
Was This Post Helpful? 0
  • +
  • -

#3 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8332
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: "Next Page" function?

Posted 19 November 2008 - 06:51 PM

Not that easy to remove a Panel and replace it by another one
but you can use a card layout
Was This Post Helpful? 0
  • +
  • -

#4 mumeisyuu  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 55
  • Joined: 03-October 08

Re: "Next Page" function?

Posted 20 November 2008 - 05:14 AM

View Postpbl, on 19 Nov, 2008 - 05:51 PM, said:

Not that easy to remove a Panel and replace it by another one
but you can use a card layout


I've tried the cardLayout a little bit and it seems to be working fine
However I have a question:

Coz my attempy on the cardLayout is with very simple panel, which consists of only a few components
However, if the "cards" are larger, that is with a lot components
Is cardLayout powerful enough to handle the "page swtiching" function?

Or is there any better way to get around?

Because I am trying to make a simple offline-game
So I'd like to create something like
Enter name > Select class > Distribute Attribute > Select Opponents ..... > END

For each step I want to put it on a separated "page".

Or should I do it some other way?

Thanks :D
Was This Post Helpful? 0
  • +
  • -

#5 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8332
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: "Next Page" function?

Posted 20 November 2008 - 05:20 AM

If you want windows that pop up you can you JOptionPane.

Or you can use a JOptionPane enabling only the pane that should be "active"

"However, if the "cards" are larger, that is with a lot components"

Don't really understand your question
Was This Post Helpful? 0
  • +
  • -

#6 mumeisyuu  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 55
  • Joined: 03-October 08

Re: "Next Page" function?

Posted 20 November 2008 - 10:33 AM

View Postpbl, on 20 Nov, 2008 - 04:20 AM, said:

If you want windows that pop up you can you JOptionPane.

Or you can use a JOptionPane enabling only the pane that should be "active"

"However, if the "cards" are larger, that is with a lot components"

Don't really understand your question


Hmmm~ nevermind I will try to play around with the cardlayout a little more~
I think I've found a way to get around it :D

I shall come back and ask if I've got anymore question~
Thanks a lot :D
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1