private JToolBar sttool = new JToolBar();
private String[] sttype = {"값1","값2", "값3","값4","값5","값6"};
private JComboBox<String> stcotype = new JComboBox<String>(sttype);
private String[] staddr = {"1","2","3", "4"};
private JComboBox<String> stcoaddr = new JComboBox<String>(staddr);
private String[] staddr1 = {"5","6","7", "8"};
private JComboBox<String> stcoaddr1 = new JComboBox<String>(staddr1);
try{
conn = ConnUtil.getConnection();
pstmt = conn.prepareStatement(sql.toString());
pstmt.setString(1,stnametf.getText().trim());
pstmt.setString(2,stteltf.getText().trim( ) );
pstmt.setString(3,stcotype.getText().trim());// 에러
pstmt.setString(4,stcoaddr.getText().trim());// 에러
pstmt.setString(5,stcoaddr1.getText().trim());// 에러
pstmt.setString(6,sttexta.getText().trim());
}catch()
public void init(){
stnametf.setText("");
stteltf.setText("");
stcotype.setText("");//에러
stcoaddr.setText("");//에러
stcoaddr1.setText("");//에러
sttexta.requestFocus();
}
이렇게 하면 에러가 나는데 지금 툴바에 있는 콤보박스안에 값을 가져오는데서 에러가 나는데요 getText() 이게 지금 아닌것같은데 어떻게 해야 값을 가져올 수 있을까요??
알려주세요ㅠㅠ
에러나온 목록입니다
---------- 컴파일 ----------
C:MyWorkBBcallBBcallStoreEx.java:107: error: cannot find symbol
pstmt.setString(3,stcotype.getText.trim());//
^
symbol: variable getText
location: variable stcotype of type JComboBox<String>
C:MyWorkBBcallBBcallStoreEx.java:108: error: cannot find symbol
pstmt.setString(4,stcoaddr.getText().trim());//
^
symbol: method getText()
location: variable stcoaddr of type JComboBox<String>
C:MyWorkBBcallBBcallStoreEx.java:109: error: cannot find symbol
pstmt.setString(5,stcoaddr1.getText().trim());//
^
symbol: method getText()
location: variable stcoaddr1 of type JComboBox<String>
C:MyWorkBBcallBBcallStoreEx.java:144: error: cannot find symbol
stcotype.setText("");
^
symbol: method setText(String)
location: variable stcotype of type JComboBox<String>
C:MyWorkBBcallBBcallStoreEx.java:145: error: cannot find symbol
stcoaddr.setText("");
^
symbol: method setText(String)
location: variable stcoaddr of type JComboBox<String>
C:MyWorkBBcallBBcallStoreEx.java:146: error: cannot find symbol
stcoaddr1.setText("");
^
symbol: method setText(String)
location: variable stcoaddr1 of type JComboBox<String>
6 errors
출력 완료 (2초 경과) - 정상 종료
댓글 0