Download - Svetlin Nakov
Download - Svetlin Nakov
Download - Svetlin Nakov
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
mLibraryFileNameTextField.setBounds(new Rectangle(10, 25, 315, 20));<br />
mLibraryFileNameTextField.setFont(new Font("DialogInput", 0, 12));<br />
mLibraryFileNameTextField.setEditable(false);<br />
mLibraryFileNameTextField.setBackground(SystemColor.control);<br />
// Initialize browse button<br />
mBrowseForLibraryFileButton.setText("Browse");<br />
mBrowseForLibraryFileButton.setBounds(new Rectangle(330, 25, 80, 20));<br />
mBrowseForLibraryFileButton.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
browseForLibraryButton_actionPerformed();<br />
}<br />
});<br />
// Initialize PIN code label<br />
mEnterPINCodeLabel.setText("Enter the PIN code to access your smart card:");<br />
mEnterPINCodeLabel.setBounds(new Rectangle(10, 55, 350, 15));<br />
mEnterPINCodeLabel.setFont(new Font("Dialog", 0, 12));<br />
// Initialize PIN code text field<br />
mPINCodeTextField.setBounds(new Rectangle(10, 75, 400, 20));<br />
mPINCodeTextField.setFont(new Font("DialogInput", 0, 12));<br />
// Initialize sign button<br />
mSignButton.setText("Sign");<br />
mSignButton.setBounds(new Rectangle(110, 105, 75, 25));<br />
mSignButton.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
signButton_actionPerformed();<br />
}<br />
});<br />
// Initialize cancel button<br />
mCancelButton.setText("Cancel");<br />
mCancelButton.setBounds(new Rectangle(220, 105, 75, 25));<br />
mCancelButton.addActionListener(new ActionListener() {<br />
public void actionPerformed(ActionEvent e) {<br />
cancelButton_actionPerformed();<br />
}<br />
});<br />
// Add the initialized components into the dialog's content pane<br />
this.getContentPane().add(mChooseLibraryFileLabel, null);<br />
this.getContentPane().add(mLibraryFileNameTextField, null);<br />
this.getContentPane().add(mBrowseForLibraryFileButton, null);<br />
this.getContentPane().add(mEnterPINCodeLabel, null);<br />
this.getContentPane().add(mPINCodeTextField, null);<br />
this.getContentPane().add(mSignButton, null);<br />
this.getContentPane().add(mCancelButton, null);<br />
this.getRootPane().setDefaultButton(mSignButton);<br />
}<br />
// Add some functionality for focusing the most appropriate<br />
// control when the dialog is shown<br />
this.addWindowListener(new WindowAdapter() {<br />
public void windowOpened(WindowEvent windowEvent) {<br />
String libraryFileName = mLibraryFileNameTextField.getText();<br />
if (libraryFileName != null && libraryFileName.length() != 0)<br />
mPINCodeTextField.requestFocus();<br />
else<br />
mBrowseForLibraryFileButton.requestFocus();<br />
}<br />
});<br />
103