관리 메뉴

moozi

JTabbedPane 본문

TIS_2020/빅데이터2020_1기

JTabbedPane

moozi 2020. 9. 17. 10:55
import java.awt.Container;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class TabbedPaneEx extends JFrame{
	public TabbedPaneEx() {
		this.setTitle("탭");
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		Container c=this.getContentPane();
		JTabbedPane pane=createTabbedPane();
		c.add(pane);
		this.setSize(250, 250);
		this.setVisible(true);
	}
	private JTabbedPane createTabbedPane() {
		JTabbedPane pane=new JTabbedPane();
		pane.addTab("로그인", new LogIn());
		pane.addTab("회원가입",new MemberJoin());
		return pane;
	}
	class LogIn extends JPanel{
		public LogIn(){
			this.add(new JLabel("로그인"));
			this.setSize(200, 200);
			this.setVisible(true);
		}
	}
	class MemberJoin extends JPanel{
		public MemberJoin(){
			this.add(new JLabel("회원가입"));
			this.setSize(200, 200);
			this.setVisible(true);
		}
	}
	public static void main(String[] args) {
		new TabbedPaneEx();

	}

}

'TIS_2020 > 빅데이터2020_1기' 카테고리의 다른 글

ANSI SQL inner join  (0) 2020.09.22
9/21 sql  (0) 2020.09.21
msvcr100.dll  (0) 2020.09.18
Java Event 처리 정리  (0) 2020.09.18
JTabbedPane  (0) 2020.09.17
Haksa  (0) 2020.09.14
0 Comments
댓글쓰기 폼