You are here: Home / Topics / Page / 5

Program to explain Dialog class in Java

Filed under: Java on 2023-10-25 06:46:42
//  Program to explain Dialog class.import java.applet.*;import java.awt.*;import java.awt.event.*;class MyDialog extends Dialog implements ActionListener{  Button b1;  Label l1;    MyDialog( Frame f, String s, boolean u )  { super( f, s, u ); setLayout( 

Program to use GridBagLayout in Java

Filed under: Java on 2023-10-25 06:46:11
// Program to use GridBagLayout.import java.awt.*;import java.awt.event.*;public class GridBagLayoutDemo1 extends Frame{GridBagLayout gb;GridBagConstraints gbc;Button b1, b2, b3, b4, b5, b6, b7;public GridBagLayoutDemo1( String s ){ super( s );    gb = new GridBagLayout(); g

Program to explain CardLayout in Java

Filed under: Java on 2023-10-25 06:45:42
//  Program to explain CardLayout.import java.awt.*;import java.awt.event.*;import java.applet.*;/*<applet code="CardLayoutDemo" width=300 height=100></applet>*/public class CardLayoutDemo extends Applet implements ActionListener, MouseListener {Button b1, b2, b3, b4, b5;Panel 

Program to use GridLayout in Java

Filed under: Java on 2023-10-25 06:45:00
//  Program to use GridLayout.import java.awt.*;import java.awt.event.*;import java.applet.*;/*<applet code="GridLayoutDemo" width="300" height="150"></applet>*/public class GridLayoutDemo extends Applet {Button b1, b2, b3, b4, b5;public void init() { setLayout(new Gr

Program to use Insets in Java

Filed under: Java on 2023-10-25 06:44:35
// Program to use Insets.import java.awt.*;import java.awt.event.*;import java.applet.*;/*<applet code="InsetsDemo" width="300" height="150"></applet>*/public class InsetsDemo extends Applet {Button b1, b2, b3, b4, b5;public void init() { setLayout(new BorderLayout());&nbs

Program to use BorderLayout in Java

Filed under: Java on 2023-10-25 06:44:03
//  Program to use BorderLayout.import java.awt.*;import java.awt.event.*;import java.applet.*;/*<applet code="BorderLayoutDemo" width="300" height="150"></applet>*/public class BorderLayoutDemo extends Applet {Button b1, b2, b3, b4, b5;public void init() { setLayout(

Program to use FlowLayout in Java

Filed under: Java on 2023-10-25 06:43:36
//  Program to use FlowLayout.import java.awt.*;import java.awt.event.*;import java.applet.*;/*<applet code="FlowLayoutDemo" width="300" height="150"></applet>*/public class FlowLayoutDemo extends Applet {Button b1, b2, b3, b4, b5;public void init() { setLayout(new Fl

Program to use Scrollbar AWT control in Java

Filed under: Java on 2023-10-25 06:43:08
//  Program to use Scrollbar AWT control.import java.awt.*;import java.awt.event.*;import java.applet.*;/*<applet code="ScrollbarDemo" width="250" height="150"></applet>*/public class ScrollbarDemo extends Applet implements AdjustmentListener, MouseMotionListener {String msg =