Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

slow loading of JPanel

 
D Preethi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello swing experts,

I had a requirement in which I want a JPanel to be shown slowly in the UI. To explain more clearly, I have 3 radio buttons. Second and third radio button have a JPanel right below them. Now, when I click on second radio button, only the panel that is associated with it will be shown, and not the panel associated with third radio button. So, when I click on the second radio button, I want the JPanel associated with it to be slowly loaded in the UI, rather than at once. Has anyone tried something similar before and if so, how to achieve this?

Thanks,
Preethi


 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Preethi,

can you please explain in more detail. what I understand you have take different panel to all three radio button. So my question is why you are not using one panel for all three radio button.. ??
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
also, do you mean showing slowly from top to bottom, or slowly using tranparency?
 
D Preethi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael/Nishan,

The problem I have is, I do not have space to show JPanels belonging to both second and third radio buttons on the screen at the same time. And, the JPanel is having irrelevant info w.r.t the first radio button. So, I cannot have one JPanel after showing the 3 radio buttons. (does not look very intuitive too)

So, this is what it would look like -

<Radio Button 1>
<Radio Button 2>
<JPanel 1>
<Radio Button 3>
<JPanel 2>

JPanel 1 is enabled and shown whereas JPanel 2 is hidden when radio button 2 is selected.
JPanel 2 is enabled and shown whereas JPanel 1 is hidden when radio button 3 is selected.


First of all, this design should work, right?
Next, what I want is, when Radio button 2 is selected, I want JPanel 1 to slowly load. When Radio button 3 is selected, I want JPanel 2 is slowly load.


Thanks,
Preethi
 
Peter Taucher
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you didn't answer Michael's question. How do you define 'slow loading'? I think you want something similar to JXTaskPane (with expand/collapse animation) ... but that's not really an easy behaviour to achieve.
 
D Preethi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Peter, I am actually looking for some kind of animation. Is there any such support in java 5?

- Preethi
 
D Preethi
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael/Peter,

I am not sure how easy it would be to achieve slow loading through transparency. Can you explain on how I could achieve this? Maybe that could work too.


Thanks,
Preethi
 
lzr zhao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
D Preethi wrote:Hello swing experts,

I had a requirement in which I want a JPanel to be shown slowly in the UI. To explain more clearly, I have 3 radio buttons. Second and third radio button have a JPanel right below them. Now, when I click on second radio button, only the panel that is associated with it will be shown, and not the panel associated with third radio button. So, when I click on the second radio button, I want the JPanel associated with it to be slowly loaded in the UI, rather than at once. Has anyone tried something similar before and if so, how to achieve this?

Thanks,
Preethi




new thread and show a dialog
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic