JPanel
/* Copy Code */
import javax.swing.*;
import java.awt.*;
import javax.swing.border.MatteBorder;
public class MyPanel {
MyPanel(){
JFrame frame=new JFrame("JPanel");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jpnl=new JPanel();
jpnl.setBounds(300, 50, 250, 200);
Color txtcolor=new Color(0,0,0);
jpnl.setForeground(txtcolor);
Color bgcolor=new Color(52,94,137);
jpnl.setBackground(bgcolor);
jpnl.setFont(new Font("verdana", Font.BOLD, 17));
Color bordercolor=new Color(255,0,0);
jpnl.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, bordercolor));
frame.add(jpnl);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyPanel();
}
}
/* end */
JPanel
/* Copy Code */
import javax.swing.*;
import java.awt.*;
import javax.swing.border.MatteBorder;
public class MyPanel {
MyPanel(){
JFrame frame=new JFrame("JPanel");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jpnl=new JPanel();
jpnl.setBounds(0, 0, 600, 200);
Color txtcolor=new Color(0,0,0);
jpnl.setForeground(txtcolor);
Color bgcolor=new Color(255,255,255);
jpnl.setBackground(bgcolor);
jpnl.setFont(new Font("verdana", Font.BOLD, 17));
Color bordercolor=new Color(255,0,0);
jpnl.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, bordercolor));
frame.add(jpnl);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyPanel();
}
}
/* end */
JPanel
/* Copy Code */
import javax.swing.*;
import java.awt.*;
import javax.swing.border.MatteBorder;
public class MyPanel {
MyPanel(){
JFrame frame=new JFrame("JPanel");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jpnl=new JPanel();
jpnl.setBounds(300, 50, 250, 200);
Color txtcolor=new Color(66,52,52);
jpnl.setForeground(txtcolor);
Color bgcolor=new Color(255,255,255);
jpnl.setBackground(bgcolor);
jpnl.setFont(new Font("verdana", Font.BOLD, 17));
Color bordercolor=new Color(255,0,0);
jpnl.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, bordercolor));
frame.add(jpnl);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyPanel();
}
}
/* end */
JPanel
/* Copy Code */
import javax.swing.*;
import java.awt.*;
import javax.swing.border.MatteBorder;
public class MyPanel {
MyPanel(){
JFrame frame=new JFrame("JPanel");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jpnl=new JPanel();
jpnl.setBounds(187, 56, 328, 248);
Color txtcolor=new Color(0,0,0);
jpnl.setForeground(txtcolor);
Color bgcolor=new Color(255,255,255);
jpnl.setBackground(bgcolor);
jpnl.setFont(new Font("verdana", Font.BOLD, 17));
Color bordercolor=new Color(0,0,0);
jpnl.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, bordercolor));
frame.add(jpnl);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyPanel();
}
}
/* end */
JPanel
/* Copy Code */
import javax.swing.*;
import java.awt.*;
import javax.swing.border.MatteBorder;
public class MyPanel {
MyPanel(){
JFrame frame=new JFrame("JPanel");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jpnl=new JPanel();
jpnl.setBounds(300, 50, 250, 200);
Color txtcolor=new Color(0,0,0);
jpnl.setForeground(txtcolor);
Color bgcolor=new Color(255,255,255);
jpnl.setBackground(bgcolor);
jpnl.setFont(new Font("verdana", Font.BOLD, 17));
Color bordercolor=new Color(255,0,0);
jpnl.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, bordercolor));
frame.add(jpnl);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyPanel();
}
}
/* end */
JPanel
/* Copy Code */
import javax.swing.*;
import java.awt.*;
import javax.swing.border.MatteBorder;
public class MyPanel {
MyPanel(){
JFrame frame=new JFrame("JPanel");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jpnl=new JPanel();
jpnl.setBounds(197, 71, 322, 237);
Color txtcolor=new Color(0,0,0);
jpnl.setForeground(txtcolor);
Color bgcolor=new Color(255,255,255);
jpnl.setBackground(bgcolor);
jpnl.setFont(new Font("verdana", Font.BOLD, 0));
Color bordercolor=new Color(255,0,0);
jpnl.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, bordercolor));
frame.add(jpnl);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyPanel();
}
}
/* end */
JPanel
/* Copy Code */
import javax.swing.*;
import java.awt.*;
import javax.swing.border.EtchedBorder;
public class MyPanel {
MyPanel(){
JFrame frame=new JFrame("JPanel");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jpnl=new JPanel();
jpnl.setBounds(0, 0, 200, 400);
Color txtcolor=new Color(0,0,0);
jpnl.setForeground(txtcolor);
Color bgcolor=new Color(255,31,31);
jpnl.setBackground(bgcolor);
jpnl.setFont(new Font("verdana", Font.BOLD, 20));
jpnl.setBorder(BorderFactory.createEtchedBorder(0));
frame.add(jpnl);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyPanel();
}
}
/* end */
JPanel
/* Copy Code */
import javax.swing.*;
import java.awt.*;
import javax.swing.border.EtchedBorder;
public class MyPanel {
MyPanel(){
JFrame frame=new JFrame("JPanel");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jpnl=new JPanel();
jpnl.setBounds(0, 0, 200, 300);
Color txtcolor=new Color(0,0,0);
jpnl.setForeground(txtcolor);
Color bgcolor=new Color(255,255,255);
jpnl.setBackground(bgcolor);
jpnl.setFont(new Font("verdana", Font.BOLD, 17));
jpnl.setBorder(BorderFactory.createEtchedBorder(0));
frame.add(jpnl);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyPanel();
}
}
/* end */
JPanel
/* Copy Code */
import javax.swing.*;
import java.awt.*;
import javax.swing.border.MatteBorder;
public class MyPanel {
MyPanel(){
JFrame frame=new JFrame("JPanel");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel jpnl=new JPanel();
jpnl.setBounds(0, 0, 250, 200);
Color txtcolor=new Color(0,0,0);
jpnl.setForeground(txtcolor);
Color bgcolor=new Color(255,255,255);
jpnl.setBackground(bgcolor);
jpnl.setFont(new Font("monospace", Font.BOLD, 17));
Color bordercolor=new Color(219,0,0);
jpnl.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, bordercolor));
frame.add(jpnl);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyPanel();
}
}
/* end */