當前位置: 首頁>>代碼示例>>Java>>正文


Java JPasswordField.setColumns方法代碼示例

本文整理匯總了Java中javax.swing.JPasswordField.setColumns方法的典型用法代碼示例。如果您正苦於以下問題:Java JPasswordField.setColumns方法的具體用法?Java JPasswordField.setColumns怎麽用?Java JPasswordField.setColumns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JPasswordField的用法示例。


在下文中一共展示了JPasswordField.setColumns方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Main

import javax.swing.JPasswordField; //導入方法依賴的package包/類
public Main() {
	setTitle("Twitch Comment Talker");
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	ImageIcon icon = new ImageIcon("./icon.png");
    setIconImage(icon.getImage());
	setBounds(100, 100, 300, 248);
	setResizable(false);
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);
	contentPane.setLayout(null);

	JLabel lblAuthPassword = new JLabel("OAuth Pass");
	lblAuthPassword.setBounds(12, 10, 86, 13);
	contentPane.add(lblAuthPassword);

	textAuthPassword = new JPasswordField();
	textAuthPassword.setBounds(110, 7, 172, 19);
	contentPane.add(textAuthPassword);
	textAuthPassword.setEchoChar('*');
	textAuthPassword.setColumns(10);
	textAuthPassword.setEditable(false);

	JLabel lblUserName = new JLabel("Channel Name");
	lblUserName.setBounds(12, 33, 86, 13);
	contentPane.add(lblUserName);

	textUserName = new JTextField();
	textUserName.setBounds(110, 30, 172, 19);
	contentPane.add(textUserName);
	textUserName.setColumns(10);
	textUserName.setToolTipText("https://www.twitch.tv/~~~の~~~部分をそのまま入力して下さい。");

	btnConnect.setBounds(8, 148, 276, 38);
	contentPane.add(btnConnect);
	btnConnect.addActionListener(this);
	btnConnect.setActionCommand("btnConnect");
	btnConnect.setToolTipText("Twitchコメントに接続します。");

	JLabel lblStatus = new JLabel("Status:");
	lblStatus.setBounds(12, 196, 43, 13);
	contentPane.add(lblStatus);

	lblStatus_1.setBounds(67, 196, 215, 13);
	contentPane.add(lblStatus_1);

	chkReadName.setBounds(8, 52, 264, 21);
	contentPane.add(chkReadName);
	chkReadName.addActionListener(this);
	chkReadName.setActionCommand("chkReadName");
	chkReadName.setToolTipText("コメント投稿者のユーザー名を読み上げます。");

	chkUseEnglish.setBounds(8, 75, 137, 21);
	contentPane.add(chkUseEnglish);
	chkUseEnglish.addActionListener(this);
	chkUseEnglish.setActionCommand("chkUseEnglish");
	chkUseEnglish.setToolTipText("英文が投稿された時、SAPI5で読み上げをします。");


	btnSAPI = new JButton(vapi.getVoice());
	btnSAPI.setBounds(153, 76, 129, 19);
	contentPane.add(btnSAPI);
	btnSAPI.addActionListener(this);
	btnSAPI.setActionCommand("btnSAPI");
	
	chkPopup.setBounds(8, 121, 137, 21);
	contentPane.add(chkPopup);
	chkPopup.addActionListener(this);
	chkPopup.setActionCommand("chkPopup");
	chkPopup.setToolTipText("コメント受信時に通知ポップアップを表示します。");
	
	chkReadEmote.setBounds(8, 98, 137, 21);
	contentPane.add(chkReadEmote);
	chkReadEmote.addActionListener(this);
	chkReadEmote.setActionCommand("chkReadEmote");
	chkReadEmote.setToolTipText("エモート語句を読み上げします。");

	loadConfigFile();
	
}
 
開發者ID:advancedbear,項目名稱:TwitchBouyomi,代碼行數:81,代碼來源:Main.java

示例2: SignUpPanel

import javax.swing.JPasswordField; //導入方法依賴的package包/類
/**
 * Create the panel.
 */
public SignUpPanel() {
	setLayout(null);
	
	JLabel lblNewLabel = new JLabel("Hearthstone");
	lblNewLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 35));
	lblNewLabel.setBounds(150, 35, 211, 61);
	add(lblNewLabel);
	
	JPanel panel = new JPanel();
	panel.setBorder(new LineBorder(new Color(0, 0, 0)));
	panel.setBounds(434, 20, 245, 260);
	add(panel);
	panel.setLayout(null);
	
	JLabel lblUpdateNotes = new JLabel("Update Notes:");
	lblUpdateNotes.setBounds(6, 6, 89, 16);
	panel.add(lblUpdateNotes);
	
	JTextPane txtpn_UpdateNotes = new JTextPane();
	txtpn_UpdateNotes.setEditable(false);
	txtpn_UpdateNotes.setBackground(this.getBackground());
	txtpn_UpdateNotes.setText("* Added Support for Multiplayer\n\n\n* Support for login\n\n\n* Server can hold multiple games at once");
	txtpn_UpdateNotes.setBounds(16, 34, 211, 207);
	panel.add(txtpn_UpdateNotes);
	
	JLabel label = new JLabel("Username:");
	label.setBounds(58, 103, 70, 16);
	add(label);
	
	txt_Username = new JTextField();
	txt_Username.setColumns(20);
	txt_Username.setBounds(134, 97, 254, 28);
	add(txt_Username);
	
	JLabel label_1 = new JLabel("Password:");
	label_1.setBounds(65, 151, 63, 16);
	add(label_1);
	
	psf_Password = new JPasswordField();
	psf_Password.setColumns(20);
	psf_Password.setBounds(134, 145, 254, 28);
	add(psf_Password);
	
	pwf_Retype = new JPasswordField();
	pwf_Retype.setColumns(20);
	pwf_Retype.setBounds(134, 191, 254, 28);
	add(pwf_Retype);
	
	JLabel lblRetypePassword = new JLabel("Retype Password:");
	lblRetypePassword.setBounds(19, 197, 109, 16);
	add(lblRetypePassword);
	
	btn_Login = new JButton("Login");
	btn_Login.setBounds(134, 240, 117, 29);
	add(btn_Login);
	
	btn_SignUp = new JButton("Sign Up");
	btn_SignUp.setBounds(271, 240, 117, 29);
	add(btn_SignUp);

}
 
開發者ID:ikhaliq15,項目名稱:JHearthstone,代碼行數:65,代碼來源:SignUpPanel.java

示例3: LoginPanel

import javax.swing.JPasswordField; //導入方法依賴的package包/類
/**
 * Create the panel.
 */
public LoginPanel() {
	setLayout(null);
	
	jpf_Password = new JPasswordField();
	jpf_Password.setBounds(123, 188, 254, 28);
	jpf_Password.setColumns(20);
	add(jpf_Password);
	
	btn_Submit = new JButton("Login");
	btn_Submit.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent e) {
		}
	});
	btn_Submit.setBounds(123, 228, 117, 29);
	add(btn_Submit);
	
	JLabel lblPassword = new JLabel("Password:");
	lblPassword.setBounds(54, 194, 63, 16);
	add(lblPassword);
	
	JLabel lblUsername = new JLabel("Username:");
	lblUsername.setBounds(47, 127, 70, 16);
	add(lblUsername);
	
	jtf_Username = new JTextField();
	jtf_Username.setBounds(123, 121, 254, 28);
	add(jtf_Username);
	jtf_Username.setColumns(20);
	
	JPanel panel = new JPanel();
	panel.setBorder(new LineBorder(new Color(0, 0, 0)));
	panel.setBounds(434, 20, 245, 260);
	add(panel);
	panel.setLayout(null);
	
	JLabel lblUpdateNotes = new JLabel("Update Notes:");
	lblUpdateNotes.setBounds(6, 6, 89, 16);
	panel.add(lblUpdateNotes);
	
	JTextPane txtpn_UpdateNotes = new JTextPane();
	txtpn_UpdateNotes.setEditable(false);
	txtpn_UpdateNotes.setBackground(this.getBackground());
	txtpn_UpdateNotes.setText("* Added Support for Multiplayer\n\n\n* Support for login\n\n\n* Server can hold multiple games at once");
	txtpn_UpdateNotes.setBounds(16, 34, 211, 207);
	panel.add(txtpn_UpdateNotes);
	
	JLabel lblNewLabel = new JLabel("Hearthstone");
	lblNewLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 35));
	lblNewLabel.setBounds(150, 35, 211, 61);
	add(lblNewLabel);
			
	btn_SignUp = new JButton("Sign Up");
	btn_SignUp.setBounds(260, 228, 117, 29);
	add(btn_SignUp);

}
 
開發者ID:ikhaliq15,項目名稱:JHearthstone,代碼行數:60,代碼來源:LoginPanel.java

示例4: passPane

import javax.swing.JPasswordField; //導入方法依賴的package包/類
/**
 * Create the panel.
 */
public passPane(String name, String mail)
{
	this.name = name;
	this.mail = mail;

	JLabel label = new JLabel("Wählen Sie ihr Passwort:");

	passwordField = new JPasswordField();
	passwordField.setColumns(15);
	passwordField.setText(standardPassword);

	passwordField_control = new JPasswordField();
	passwordField_control.setColumns(15);
	passwordField_control.setText(standardPassword);

	btnWeiter = new JButton("weiter");
	btnWeiter.setActionCommand("weiter");
	btnWeiter.addActionListener(new ActionHandler());
	btnAbbrechen = new JButton("abbrechen");
	btnAbbrechen.setActionCommand("abbrechen");
	btnAbbrechen.addActionListener(new ActionHandler());
	errorLabel = new JLabel("Fehler!");
	errorLabel.setForeground(Color.RED);
	errorLabel.setVisible(false);

	GroupLayout groupLayout = new GroupLayout(this);
	groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
			.addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(btnAbbrechen)
					.addPreferredGap(ComponentPlacement.RELATED, 236, Short.MAX_VALUE).addComponent(btnWeiter)
					.addContainerGap())
			.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
							.addGroup(
									groupLayout.createSequentialGroup().addContainerGap().addComponent(label,
											GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE))
							.addGroup(groupLayout.createSequentialGroup().addGap(152)
									.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
											.addComponent(passwordField_control, GroupLayout.PREFERRED_SIZE,
													GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
											.addComponent(passwordField))))
					.addGap(129))
			.addGroup(Alignment.LEADING, groupLayout.createSequentialGroup().addContainerGap()
					.addComponent(errorLabel).addContainerGap(368, Short.MAX_VALUE)));
	groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
			.createSequentialGroup().addContainerGap().addComponent(label).addGap(38)
			.addComponent(passwordField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
					GroupLayout.PREFERRED_SIZE)
			.addGap(50)
			.addComponent(passwordField_control, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
					GroupLayout.PREFERRED_SIZE)
			.addGap(45).addComponent(errorLabel)
			.addPreferredGap(ComponentPlacement.RELATED, 50, Short.MAX_VALUE).addGroup(groupLayout
					.createParallelGroup(Alignment.BASELINE).addComponent(btnWeiter).addComponent(btnAbbrechen))
			.addContainerGap()));
	setLayout(groupLayout);

}
 
開發者ID:AnonymOnline,項目名稱:saveOrganizer,代碼行數:61,代碼來源:passPane.java

示例5: PassAsk

import javax.swing.JPasswordField; //導入方法依賴的package包/類
/**
 * Create the frame.
 */
public PassAsk()
{
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	setBounds(100, 100, 450, 300);
	setLocationRelativeTo(null);
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);

	JLabel taskLabel = new JLabel("Geben Sie ihr Passwort ein:");

	passwordField = new JPasswordField();
	passwordField.setColumns(15);

	JButton btnWeiter = new JButton("weiter");
	btnWeiter.setActionCommand("weiter");
	btnWeiter.addActionListener(new ActionHandler());

	btnAbbrechen = new JButton("abbrechen");
	btnAbbrechen.setActionCommand("abbrechen");
	btnAbbrechen.addActionListener(new ActionHandler());

	errorLabel = new JLabel("Error");
	errorLabel.setForeground(Color.RED);
	errorLabel.setVisible(false);

	GroupLayout gl_contentPane = new GroupLayout(contentPane);
	gl_contentPane.setHorizontalGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING).addGroup(gl_contentPane
			.createSequentialGroup().addContainerGap()
			.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_contentPane.createSequentialGroup().addComponent(taskLabel).addContainerGap(231,
							Short.MAX_VALUE))
					.addGroup(gl_contentPane.createSequentialGroup().addComponent(btnAbbrechen)
							.addPreferredGap(ComponentPlacement.RELATED, 226, Short.MAX_VALUE)
							.addComponent(btnWeiter).addContainerGap())
					.addGroup(Alignment.TRAILING,
							gl_contentPane.createSequentialGroup()
									.addComponent(passwordField, GroupLayout.PREFERRED_SIZE,
											GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addGap(130))
					.addGroup(gl_contentPane.createSequentialGroup().addComponent(errorLabel).addContainerGap(358,
							Short.MAX_VALUE)))));
	gl_contentPane
			.setVerticalGroup(
					gl_contentPane.createParallelGroup(Alignment.LEADING)
							.addGroup(gl_contentPane.createSequentialGroup().addGap(40).addComponent(taskLabel)
									.addGap(35)
									.addComponent(passwordField, GroupLayout.PREFERRED_SIZE,
											GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addPreferredGap(ComponentPlacement.RELATED, 92, Short.MAX_VALUE)
									.addComponent(errorLabel).addGap(37)
									.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
											.addComponent(btnWeiter).addComponent(btnAbbrechen))
									.addContainerGap()));
	contentPane.setLayout(gl_contentPane);
}
 
開發者ID:AnonymOnline,項目名稱:saveOrganizer,代碼行數:60,代碼來源:PassAsk.java


注:本文中的javax.swing.JPasswordField.setColumns方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。