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


Java JScrollPane.setAutoscrolls方法代碼示例

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


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

示例1: KeHuChaXun

import javax.swing.JScrollPane; //導入方法依賴的package包/類
public KeHuChaXun() {
	super();
	setIconifiable(true);
	setClosable(true);
	setTitle("�ͻ���Ϣ��ѯ");
	getContentPane().setLayout(new GridBagLayout());
	setBounds(100, 100, 640, 375);

	table = new JTable();
	table.setEnabled(false);
	table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	String[] tableHeads = new String[]{"�ͻ�ID", "�ͻ�ȫ��", "�ͻ���ַ", "�ͻ����",
			"��������", "�硡����", "��������", "��  ϵ  ��", "��ϵ�綽", "E-Mail", "��������",
			"�����˺�"};
	final DefaultTableModel dftm = (DefaultTableModel) table.getModel();
	dftm.setColumnIdentifiers(tableHeads);
	
	final JScrollPane scrollPane = new JScrollPane(table);
	scrollPane.setAutoscrolls(true);
	final GridBagConstraints gridBagConstraints_6 = new GridBagConstraints();
	gridBagConstraints_6.weighty = 1.0;
	gridBagConstraints_6.insets = new Insets(0, 10, 5, 10);
	gridBagConstraints_6.fill = GridBagConstraints.BOTH;
	gridBagConstraints_6.gridwidth = 6;
	gridBagConstraints_6.gridy = 1;
	gridBagConstraints_6.gridx = 0;
	getContentPane().add(scrollPane, gridBagConstraints_6);

	setupComponet(new JLabel(" ѡ���ѯ������"), 0, 0, 1, 1, false);
	conditionBox1 = new JComboBox();
	conditionBox1.setModel(new DefaultComboBoxModel(new String[]{"�ͻ�ȫ��",
			"�ͻ����"}));
	setupComponet(conditionBox1, 1, 0, 1, 30, true);

	conditionBox2 = new JComboBox();
	conditionBox2.setModel(new DefaultComboBoxModel(
			new String[]{"����", "����"}));
	setupComponet(conditionBox2, 2, 0, 1, 30, true);

	conditionContent = new JTextField();
	setupComponet(conditionContent, 3, 0, 1, 140, true);

	final JButton queryButton = new JButton();
	queryButton.addActionListener(new queryAction(dftm));
	queryButton.setText("��ѯ");
	setupComponet(queryButton, 4, 0, 1, 1, false);

	showAllButton = new JButton();
	showAllButton.addActionListener(new ActionListener() {
		public void actionPerformed(final ActionEvent e) {
			conditionContent.setText("");
			List list = Dao.getKhInfos();
			updateTable(list, dftm);
		}
	});
	setupComponet(showAllButton, 5, 0, 1, 1, false);
	showAllButton.setText("��ʾȫ������");
}
 
開發者ID:Edward7Zhang,項目名稱:SuperMarketManageSystem,代碼行數:59,代碼來源:KeHuChaXun.java


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