소스 질문좀요^^;
들꿈
package login;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
import javax.swing.SwingConstants;public class Register extends JFrame{
JPanel panel,p0,p1,p2,p3,p4,pb0,pb1,pb2,pb3,pb4,pb5,pb6;
ImageIcon jum,line;public Register(){
JFrame frame = new JFrame(등록정보);
Color rgb1 = new Color(241,233,246);
panel = new JPanel();
jum = new ImageIcon(C://dev/Tatoo/EnterpriseMessenger/login/Image/register/jum.jpg);
line = new ImageIcon(C://dev/Tatoo/EnterpriseMessenger/login/Image/register/line.jpg);
p1 = new JPanel();
p1.setBackground(Color.WHITE);
p1.add(new JLabel(기본 직원 정보));
p2 = new JPanel();
p3 = new JPanel();
p4 = new JPanel();
namePanel(아이디(ID) 정보);
p4.setBackground(Color.WHITE);
p4.setLayout(null);
p2.setBounds(0,0,110,30);
p3.setBounds(0,30,390,20);
p4.add(p2);
p4.add(p3);pb0 = new JPanel();
pb0.setBackground(Color.WHITE);
pb1 = new JPanel();
pb1.add(new JLabel(● 아이디(ID)));
pb1.setBackground(rgb1);
pb0.setLayout(null);
pb1.setBounds(0,0,150,30);
pb0.add(pb1);
panel.setLayout(null);
panel.setBounds(0,0,390,580);
p1.setBounds(0,0,100,30);
p4.setBounds(0,50,375,40);
pb0.setBounds(0,95,375,100);panel.add(p1);
panel.add(p4);
panel.add(pb0);
panel.setBackground(Color.WHITE);
frame.setLayout(null);
frame.getContentPane().add(panel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(390, 580);
frame.setVisible(true);
}
public void namePanel(String a){
p2.setBackground(Color.WHITE);
JLabel jl = new JLabel(jum);
jl.setBackground(Color.WHITE);
JLabel jl1 = new JLabel(a);
JLabel jl2 = new JLabel(line);
jl2.setBackground(Color.WHITE);
p3.setBackground(Color.WHITE);
p2.add(jl);
p2.add(jl1);
p3.add(jl2);}
public static void main(String args[]){
Register re = new Register();
}
}
안녕하세요^^ 매번 질문만 드려서 죄송합니다^^;
지금 짜고 있는 소스인데요
저빨간부분 텍스트를 왼쪽으로 붙이고 싶은데 안붙네요...
방법좀 갈켜주세요^^;
매번 죄송합니다^^;
-
시나브로
패널의 왼쪽인가요?
패널의 레이아웃을 FlowLayout으로 설정하시구.
FowLayout의 속성을 Left로 설정하시면 됩니다.
pb1.setLayout(new FlowLayout(FlowLayout.Left));