当前位置: 首页>>代码示例>>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;未经允许,请勿转载。