Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Swing Applet

 
JAY MaCaNaWallChucK
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy all.....yeeeehaaaa
I need a hand with a swing applet I can do awt. But how do I make the content pane.ect or do I even need it...N e way all I need is the bare bones of a Swing applet to help get me started..N e help would Be dandy.
looking for the init and how i set up the panel so i can set my lay out and put my Swing objectts in ta it......thkz partners yeeeeeeehaaaa
 
Rajendar Goud
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
yes u need a Container in swing to place a components on.Here is a sample JApplet ,which shows u the use of Container and the layout.
import java.awt.*;
import javax.swing.*;
public class japplet extends JApplet
{
Container cont;
JButton b;
public void init()
{
cont = getContentPane();
b = new JButton("Button");
cont.setLayout(new FlowLayout());
cont.add(b);
}
}
Raj
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Jay Z and Rajendar G your chosen names don't meet the javaranch naming policy. Please read the policy here and re-register if you want to continue posting. A correct user name: first name + space + last name using no initials.
Thanks,
Manfred.
 
JAY MaCaNaWallChucK
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic