本文整理匯總了Java中java.awt.Checkbox.setBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java Checkbox.setBounds方法的具體用法?Java Checkbox.setBounds怎麽用?Java Checkbox.setBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.Checkbox
的用法示例。
在下文中一共展示了Checkbox.setBounds方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addCheckBoxes
import java.awt.Checkbox; //導入方法依賴的package包/類
private void addCheckBoxes() {
activeFeedbackCheckbox = new Checkbox("");
activeFeedbackCheckbox.setFocusable(false);
activeFeedbackCheckbox.setState(cfg.getIsActiveFeedbackEnabled());
activeFeedbackCheckbox.setBackground(COLOR_UI_BACKGROUND);
activeFeedbackCheckbox.setBounds(BOUNDS_ACTIVE_FEEDBACK_CHECKBOX);
getContentPane().add(activeFeedbackCheckbox);
defaultCollatedCheckbox = new Checkbox("");
defaultCollatedCheckbox.setFocusable(false);
defaultCollatedCheckbox.setState(cfg.getIsDefaultCollated());
defaultCollatedCheckbox.setBackground(COLOR_UI_BACKGROUND);
defaultCollatedCheckbox.setBounds(new Rectangle(846, 40, 25, 25));
getContentPane().add(defaultCollatedCheckbox);
}
示例2: ConsultarPrestamo
import java.awt.Checkbox; //導入方法依賴的package包/類
public ConsultarPrestamo(Connection conn, JFrameJTable principal, String sql) {
setIconImage(Toolkit.getDefaultToolkit().getImage(ConsultarPrestamo.class.getResource("/biblioteca/images/book.png")));
this.conn=conn;
this.principal=principal;
this.principal.setEnabled(false);
setTitle("Consultar pr�stamo");
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 703, 472);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
opciones=new CheckboxGroup();
tipo=new Checkbox("Tipo", opciones, false);
usuario=new Checkbox("Usuario",opciones,true);
tipo.addItemListener(this);
usuario.addItemListener(this);
tipo.setBounds(500, 20, 62, 23);
usuario.setBounds(500, 49, 62, 23);
contentPane.add(usuario);
contentPane.add(tipo);
txtUsuario = new JTextField();
txtUsuario.setBounds(10, 33, 465, 23);
contentPane.add(txtUsuario);
txtUsuario.setColumns(10);
txtUsuario.addKeyListener(this);
btnBuscar = new JButton("Buscar");
btnBuscar.setBounds(568, 33, 109, 23);
contentPane.add(btnBuscar);
btnBuscar.addActionListener(this);
table = new PanelJtable(conn,sql,this);
table.setBounds(10, 82, 667, 340);
contentPane.add(table);
addWindowListener(this);
setVisible(true);
setLocationRelativeTo(null);
}
示例3: Login
import java.awt.Checkbox; //導入方法依賴的package包/類
Login()
{
setSize(400,190);
setTitle("Login");
setVisible(true);
setResizable(false);
setLayout(null);
setLocation(400,270);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent we)
{
if(!fg)
dispose();
}
});
//add(fg);
f=new Font("Georgia",Font.BOLD,14);
setFont(f);
tt1=new TextField();
tt1.setBounds(110,40,150,30);
tt2=new TextField();
tt2.setBounds(110,80,150,30);
tt2.setEchoChar('*');
ll1=new Label("Username:");
ll1.setBounds(25,40,80,20);
ll2=new Label("Password:");
ll2.setBounds(25,80,80,20);
ll3=new Label("");
ll3.setBounds(30,110,250,20);
ll3.setForeground(Color.red);
bb1=new Button("Login");
bb1.setBounds(280,125,100,50);
bb1.setForeground(Color.BLUE);
cb=new Checkbox("Remember Me",false);
cb.setBounds(40,130,150,20);
cb.setEnabled(true);
bb1.addActionListener(this);
add(tt1);
add(cb);
add(tt2);
add(ll3);
add(ll2);
add(ll1);
add(bb1);
}
示例4: addComponentToPane
import java.awt.Checkbox; //導入方法依賴的package包/類
public void addComponentToPane(Container pane) {
progressBar = new JProgressBar(0, 100);
progressBar.setString("ready.");
progressBar.setStringPainted(true);
selectProviderButton = new JButton(selectProviderButtonLabel);
selectProviderButton.addActionListener(new Pkcs11ActionListener());
selectProviderButton.setBounds(305, 5, 194, 30);
inputButton = new JButton(inputButtonLabel);
inputButton.addActionListener(this);
inputButton.setBounds(305, 40, 194, 30);
executeButton = new JButton("Execute!");
executeButton.setBounds(305, 75, 194, 30);
executeButton.addActionListener(this);
console = new JTextArea();
console.setBackground(Color.BLACK);
console.setForeground(Color.GREEN);
console.setBounds(4,154+30+8,494, 160);
console.setEditable(true);
console.setEnabled(true);
console.setAutoscrolls(true);
cGroup = new CheckboxGroup();
Checkbox signCb = new Checkbox("Sign", cGroup, true);
Checkbox vsignCb = new Checkbox("Verify Signature", cGroup, false);
Checkbox encryptCb = new Checkbox("Encrypt", cGroup, false);
Checkbox decryptCb = new Checkbox("Decrypt", cGroup, false);
signCb.setBounds(195, 10, 60, 15);
vsignCb.setBounds(195, 25, 100, 15);
encryptCb.setBounds(195, 40, 60, 15);
decryptCb.setBounds(195, 55, 60, 15);
progressBar.setBounds(5,140,494, 30);
JScrollPane sp = new JScrollPane(console);
sp.setBounds(5,154+30+2,494, 180);
BufferedImage logoTitle = null;
try {
logoTitle = ImageIO.read(new File("./resources/logoTitle.png"));
JLabel logoTitleLabel = new JLabel(new ImageIcon( logoTitle ));
logoTitleLabel.setBounds(0, 0, 498, 149);
pane.add(logoTitleLabel, BorderLayout.PAGE_START);
} catch (IOException e) {
String msg = "Wrong installation. The executable file must be parallel to resources/ directory. The application will try to run anyway.";
JOptionPane.showMessageDialog(new JFrame(),msg,"Error",JOptionPane.ERROR_MESSAGE);
}
pane.setLayout(null);
pane.add(selectProviderButton);
pane.add(inputButton);
pane.add(signCb);
pane.add(vsignCb);
pane.add(encryptCb);
pane.add(decryptCb);
pane.add(executeButton);
pane.add(progressBar);
pane.add(sp);
}