3
JTextField의 변형을 만들어 '검색'필드처럼 보이게하려고합니다. SeaGlass 웹 사이트에서이 문제를 보았지만 구현하는 데 문제가 있습니다 ... 모양과 느낌 그 자체가 완벽하게 작동,하지만 난 JTextField.variant 방법에 액세스 할 수 없습니다 ... 나는 다음 클래스를 테스트하고 있습니다 :SeaGlass JComponents 수정
public class Stuff extends JFrame {
JTextArea text;
JTextField field;
public Stuff() {
text = new JTextArea("something");
text.setEditable(false);
field = new JTextField(20).variant("search");
setLayout(new FlowLayout());
add(text);
add(field);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(600, 300);
}
}
이 클래스에서 호출 :
public class SeaGlassTest {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel");
new Stuff();
} catch (Exception e) {
e.printStackTrace();
}
}
}