AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

please help me out

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits
View previous topic :: View next topic  
Author Message
Praku
Guest





PostPosted: Sat Dec 23, 2006 10:44 pm    Post subject: please help me out Reply with quote



Hi,

I want to keep an animation to a frame in background and
labels,textboxes etc on foreground,for that what i have to do?
Back to top
hiwa
Guest





PostPosted: Sun Dec 24, 2006 3:09 pm    Post subject: Re: please help me out Reply with quote



Praku wrote:
Quote:
Hi,

I want to keep an animation to a frame in background and
labels,textboxes etc on foreground,for that what i have to do?
public class PrakuApplication{

JFrame frame;
AnimPanel ap;
JLabel label;
JTextArea textbox;

public PrakuApplication(){
frame = new JFrame();

ap = new AnimPanel();
ap.setLayout(.....);

label = new JLabel(.....);
textbox = new JTextArea();

ap.add(label);
ap.add(textbox);

frame.getContentPane(ap, BorderLayout.CENTER);
frame.setBounds(.....);
frame.setVisible(true);
}

public static void main(String[] args){
}
}

class AnimPanel extends JPanel{

public AnimPanel(){
// use javax.swing.Timer for running
// animation on this panel
...
}

public void paintComponent(Graphics g){
...
}
}
Back to top
Praku
Guest





PostPosted: Sun Dec 24, 2006 11:12 pm    Post subject: please help me out Reply with quote



hi,

Thnx for reply can we keep any visualization as background to a
form?and in foreground textboxes ,buttons etc..please help me this is
urgent as i am working in software company they asked us to solve that
so plz help me out
hiwa wrote:
Quote:
Praku wrote:
Hi,

I want to keep an animation to a frame in background and
labels,textboxes etc on foreground,for that what i have to do?
public class PrakuApplication{
JFrame frame;
AnimPanel ap;
JLabel label;
JTextArea textbox;

public PrakuApplication(){
frame = new JFrame();

ap = new AnimPanel();
ap.setLayout(.....);

label = new JLabel(.....);
textbox = new JTextArea();

ap.add(label);
ap.add(textbox);

frame.getContentPane(ap, BorderLayout.CENTER);
frame.setBounds(.....);
frame.setVisible(true);
}

public static void main(String[] args){
}
}

class AnimPanel extends JPanel{

public AnimPanel(){
// use javax.swing.Timer for running
// animation on this panel
...
}

public void paintComponent(Graphics g){
...
}
}
Back to top
Paul Hamaker
Guest





PostPosted: Tue Dec 26, 2006 4:25 pm    Post subject: Re: please help me out Reply with quote

Yes, since the container's paintComponent (, paintBorder) and
paintChildren are called in that order, so the child components are
painted last, on top.
--
http://javalessons.com Paul Hamaker, SEMM
Teaching ICT since 1987
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java GUI Toolkits All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.