File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes slow loading of JPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "slow loading of JPanel" Watch "slow loading of JPanel" New topic
Author

slow loading of JPanel

D Preethi
Ranch Hand

Joined: May 24, 2008
Posts: 68
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

Joined: Sep 07, 2008
Posts: 689

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.. ??


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
also, do you mean showing slowly from top to bottom, or slowly using tranparency?
D Preethi
Ranch Hand

Joined: May 24, 2008
Posts: 68
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

Joined: Nov 18, 2006
Posts: 174
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.


Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
D Preethi
Ranch Hand

Joined: May 24, 2008
Posts: 68
Yes Peter, I am actually looking for some kind of animation. Is there any such support in java 5?

- Preethi
D Preethi
Ranch Hand

Joined: May 24, 2008
Posts: 68
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

Joined: Feb 24, 2008
Posts: 8
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: slow loading of JPanel