자바로 그림삽입하는법좀 알려주세요~~
엄마몬
지금 가계부를 만들고있는데
메뉴하고 기본틀은 다만들었는데 다만들걸 보니 허전해서
각 프레임마다 그림을 집어넣을라하는데 잘안되서여 겹치고해서
그림이나 사진을 넣는법좀알려주세요
밑에는 소스입니다...부탁해요~~
import java.awt.*;
import javax.swing.*;
public class ChoiceCost {
public static void main(String[] args) {JFrame ChoiceCostf = new JFrame();
JPanel ChoiceCostp1 = new JPanel();
JPanel ChoiceCostp2 = new JPanel();
JPanel ChoiceCostp3 = new JPanel();
JPanel ChoiceCostp4 = new JPanel();
JButton ChoiceCostb5 = new JButton(선택);
JLabel ChoiceCostla1 = new JLabel(년);
JLabel ChoiceCostla2 = new JLabel(월);
JLabel ChoiceCostla3 = new JLabel(일~);
JLabel ChoiceCostla4 = new JLabel(년);
JLabel ChoiceCostla5 = new JLabel(월);
JLabel ChoiceCostla6 = new JLabel(일);
JLabel ChoiceCostla7 = new JLabel(총);
JLabel ChoiceCostla8 = new JLabel(원);
JLabel ChoiceCostla9 = new JLabel(평균);
JLabel ChoiceCostla10 = new JLabel( 원);
JTextField ChoiceCosttf1 = new JTextField(10);
JTextField ChoiceCosttf2 = new JTextField(10);
Choice ChoiceCostch1 = new Choice();
for(int y3 =2008; y3 2017; y3++){
ChoiceCostch1.add(y3 + );
}
Choice ChoiceCostch2 = new Choice();
for(int m3 =1; m3 12; m3++){
ChoiceCostch2.add(m3 + );
}
Choice ChoiceCostch3 = new Choice();
for(int d3 =1; d3 31; d3++){
ChoiceCostch3.add(d3 + );
}
Choice ChoiceCostch4 = new Choice();
for(int y4 =2008; y4 2017; y4++){
ChoiceCostch4.add(y4 + );
}
Choice ChoiceCostch5 = new Choice();
for(int m4 =1; m4 12; m4++){
ChoiceCostch5.add(m4 + );
}
Choice ChoiceCostch6 = new Choice();
for(int d4 =1; d4 31; d4++){
ChoiceCostch6.add(d4 + );
}
ChoiceCostp2.add(ChoiceCostch1);
ChoiceCostp2.add(ChoiceCostla1);
ChoiceCostp2.add(ChoiceCostch2);
ChoiceCostp2.add(ChoiceCostla2);
ChoiceCostp2.add(ChoiceCostch3);
ChoiceCostp2.add(ChoiceCostla3);
ChoiceCostp2.add(ChoiceCostch4);
ChoiceCostp2.add(ChoiceCostla4);
ChoiceCostp2.add(ChoiceCostch5);
ChoiceCostp2.add(ChoiceCostla5);
ChoiceCostp2.add(ChoiceCostch6);
ChoiceCostp2.add(ChoiceCostla6);
ChoiceCostp2.add(ChoiceCostb5);
String col[] = {0,0};
Object data[] [] ={{가전제품,0},
{식료,0} ,
{의류,0},
{세금,0},
{문화생활,0},
{교통비,0},
{교육비,0},
{제테크,0},
{기타,0}};
JTable ChoiceCosttable = new JTable(data,col);
ChoiceCostp3.add(ChoiceCosttable);
ChoiceCostp4.add(ChoiceCostla7);
ChoiceCostp4.add(ChoiceCosttf1);
ChoiceCostp4.add(ChoiceCostla8);
ChoiceCostp4.add(ChoiceCostla9);
ChoiceCostp4.add(ChoiceCosttf2);
ChoiceCostp4.add(ChoiceCostla10);
ChoiceCosttable.setRowHeight(40);
ChoiceCostf.add(ChoiceCostp1,BorderLayout.NORTH);
ChoiceCostf.add(ChoiceCostp2,BorderLayout.NORTH);
ChoiceCostf.add(ChoiceCosttable);
ChoiceCostf.add(ChoiceCostp4,BorderLayout.SOUTH);
ChoiceCostf.setSize(900,700);
ChoiceCostf.setVisible(true);
}
}
-
그댸와나
잘이해가안되서.....
-
찬바리
프레임만 백그라운드로해서 이미지만 삽입하면되는지요?
-
회전력
프레임은 백그라운드를 이미지로 지정하시면 됩니다