Frame with Panel and Button

import javax.swing.*;
public class FrameDemo6 extends JFrame 
{
	public FrameDemo6()
	{
		super("techmyguru.com");
		setSize(500,600);
		getContentPane().add(new PanelButton());
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setVisible(true);
	}
	public static void main(String[] args) 
	{
	new FrameDemo6();
	}
}

Download

PanelButton.java

import java.awt.Color;
import javax.swing.*;
public class PanelButton extends JPanel 
{
	JButton b1,b2,b3,b4;
	public PanelButton() 
	{
	super();
	b1=new JButton("Button One");
	b2=new JButton("Button Two");
	b3=new JButton("Button Three");
	b4=new JButton("Button Four");
	b1.setBackground(Color.red);
	add(b1);add(b2);
	add(b3);add(b4);
	}
}

Download

Frame in Swing

Simple Frame
Frame with Panel
Frame Menu Event ans Color Chooser
Frame with Panel and Button
TextField and TextArea
Combobox in Frame
Change Icon of Frame
Scrollbar in Frame
Scrollbar in Frame
Add picture in Frame
Label in Frame
Toggle Buttons in frame
Radio Buttons in Frame


Write your Comment

Name :
Email Id : [ We will not publish your email id ]
Your Comment : [ Maximum 200 chars ]
Enter Security code