当前位置: 首页>>代码示例>>Java>>正文


Java JTable.setEnabled方法代码示例

本文整理汇总了Java中javax.swing.JTable.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java JTable.setEnabled方法的具体用法?Java JTable.setEnabled怎么用?Java JTable.setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JTable的用法示例。


在下文中一共展示了JTable.setEnabled方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Limpar_Campos_Tela

import javax.swing.JTable; //导入方法依赖的package包/类
public static void Limpar_Campos_Tela(JPanel tela, Boolean bloquear_Componentes){
    for (Component componente : tela.getComponents()) {
        if (componente instanceof JPanel) {
            Limpar_Campos_Tela((JPanel) componente,bloquear_Componentes);
        }
        if(componente instanceof JScrollPane){
            JViewport viewport = ((JScrollPane)componente).getViewport(); 
            JTable table = (JTable)viewport.getView();
            
            DefaultTableModel model = (DefaultTableModel) table.getModel();
            model.getDataVector().removeAllElements();
            model.fireTableDataChanged();
            
            table.setEnabled(!bloquear_Componentes);
        }
        if (componente instanceof JTextField) {
            ((JTextField) componente).setText("");
            ((JTextField) componente).setEnabled(!bloquear_Componentes);
        }
        if (componente instanceof JFormattedTextField) {
            ((JFormattedTextField) componente).setText("");
            ((JFormattedTextField) componente).setEnabled(!bloquear_Componentes);
        }
        if(componente instanceof JButton){
            ((JButton) componente).setEnabled(!bloquear_Componentes);
        }
    }
}
 
开发者ID:iuryamicussi,项目名称:TrabalhoCrisParte2,代码行数:29,代码来源:Generica.java

示例2: prepareTableEdition

import javax.swing.JTable; //导入方法依赖的package包/类
/**
 * 
 */
private void prepareTableEdition(JTable table) {
	editableField = new JTextField();
	DefaultCellEditor cellEditor = new DefaultCellEditor(editableField);
	cellEditor.setClickCountToStart(1);
	table.setCellEditor(cellEditor);
	table.setEnabled(true);
}
 
开发者ID:guilhebl,项目名称:routerapp,代码行数:11,代码来源:PropertyInteractionWindow.java

示例3: GraphicTable

import javax.swing.JTable; //导入方法依赖的package包/类
public GraphicTable() {
	graphicTable = new JTable();
	
	graphicTable.setEnabled(false);
	graphicTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	graphicTable.setMinimumSize(graphicTable.getPreferredScrollableViewportSize());
	graphicTable.setPreferredScrollableViewportSize(graphicTable.getPreferredSize());
	graphicTable.setFillsViewportHeight(true);
	graphicTable.getTableHeader().setReorderingAllowed(false);
	graphicTable.setColumnSelectionAllowed(true);
	graphicTable.setRowSelectionAllowed(true);
	graphicTable.setRowSelectionAllowed(true);
	//(ListSelectionModel.SINGLE_SELECTION);
}
 
开发者ID:tteguayco,项目名称:JITRAX,代码行数:15,代码来源:GraphicTable.java

示例4: KeHuChaXun

import javax.swing.JTable; //导入方法依赖的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

示例5: ShangPinChaXun

import javax.swing.JTable; //导入方法依赖的package包/类
public ShangPinChaXun() {
	super();
	setIconifiable(true);
	setClosable(true);
	setTitle("��Ʒ��Ϣ��ѯ");
	getContentPane().setLayout(new GridBagLayout());
	setBounds(100, 100, 609, 375);

	table = new JTable();
	table.setEnabled(false);
	table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	final DefaultTableModel dftm = (DefaultTableModel) table.getModel();
	String[] tableHeads = new String[]{"�ͻ�ID", "��Ʒ����", "���", "����", "��λ",
			"���", "��װ", "����", "��׼�ĺ�", "��Ӧ��ȫ��", "��ע",};
	dftm.setColumnIdentifiers(tableHeads);

	final JScrollPane scrollPane = new JScrollPane(table);
	final GridBagConstraints gridBagConstraints_6 = new GridBagConstraints();
	gridBagConstraints_6.weighty = 1.0;
	gridBagConstraints_6.anchor = GridBagConstraints.NORTH;
	gridBagConstraints_6.insets = new Insets(0, 10, 0, 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);
	conditionName = new JComboBox();
	conditionName.setModel(new DefaultComboBoxModel(new String[]{"��Ʒ����",
			"��Ӧ��ȫ��", "����", "���"}));
	setupComponet(conditionName, 1, 0, 1, 30, true);

	conditionOperation = new JComboBox();
	conditionOperation.setModel(new DefaultComboBoxModel(new String[]{"����",
			"����"}));
	setupComponet(conditionOperation, 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));
	setupComponet(queryButton, 4, 0, 1, 1, false);
	queryButton.setText("��ѯ");

	final JButton showAllButton = new JButton();
	showAllButton.addActionListener(new ActionListener() {
		public void actionPerformed(final ActionEvent e) {
			conditionContent.setText("");
			List list = Dao.getSpInfos();
			updateTable(list, dftm);
		}
	});
	setupComponet(showAllButton, 5, 0, 1, 1, false);
	showAllButton.setText("��ʾȫ������");
}
 
开发者ID:Edward7Zhang,项目名称:SuperMarketManageSystem,代码行数:58,代码来源:ShangPinChaXun.java

示例6: XiaoShouPaiHang

import javax.swing.JTable; //导入方法依赖的package包/类
public XiaoShouPaiHang() {
	setIconifiable(true);
	setClosable(true);
	setTitle("��������");
	getContentPane().setLayout(new GridBagLayout());
	setBounds(100, 100, 650, 375);

	final JLabel label_1 = new JLabel();
	label_1.setText("��");
	final GridBagConstraints gridBagConstraints_8 = new GridBagConstraints();
	gridBagConstraints_8.anchor = GridBagConstraints.EAST;
	gridBagConstraints_8.gridy = 0;
	gridBagConstraints_8.gridx = 0;
	getContentPane().add(label_1, gridBagConstraints_8);

	year = new JComboBox();
	for (int i = 1981, j = 0; i <= date.get(Calendar.YEAR) + 1; i++, j++) {
		year.addItem(i);
		if (i == date.get(Calendar.YEAR))
			year.setSelectedIndex(j);
	}
	year.setPreferredSize(new Dimension(100, 21));
	setupComponet(year, 1, 0, 1, 90, true);

	setupComponet(new JLabel("��"), 2, 0, 1, 1, false);

	month = new JComboBox();
	for (int i = 1; i <= 12; i++) {
		month.addItem(String.format("%02d", i));
		if (date.get(Calendar.MONTH) == i)
			month.setSelectedIndex(i - 1);
	}
	month.setPreferredSize(new Dimension(100, 21));
	setupComponet(month, 3, 0, 1, 30, true);

	setupComponet(new JLabel(" �·ݵ�������Ϣ����"), 4, 0, 1, 1, false);
	condition = new JComboBox();
	condition.setModel(new DefaultComboBoxModel(new String[]{"���", "����"}));
	setupComponet(condition, 5, 0, 1, 30, true);

	setupComponet(new JLabel(" ����"), 6, 0, 1, 1, false);

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

	okButton = new JButton();
	okButton.addActionListener(new OkAction());
	setupComponet(okButton, 8, 0, 1, 1, false);
	okButton.setText("ȷ��");

	final JScrollPane scrollPane = new JScrollPane();
	final GridBagConstraints gridBagConstraints_6 = new GridBagConstraints();
	gridBagConstraints_6.weighty = 1.0;
	gridBagConstraints_6.anchor = GridBagConstraints.NORTH;
	gridBagConstraints_6.insets = new Insets(0, 10, 5, 10);
	gridBagConstraints_6.fill = GridBagConstraints.BOTH;
	gridBagConstraints_6.gridwidth = 9;
	gridBagConstraints_6.gridy = 1;
	gridBagConstraints_6.gridx = 0;
	getContentPane().add(scrollPane, gridBagConstraints_6);

	table = new JTable();
	table.setEnabled(false);
	table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	dftm = (DefaultTableModel) table.getModel();
	String[] tableHeads = new String[]{"��Ʒ���", "��Ʒ����", "���۽��", "��������",
			"���", "����", "��λ", "���", "��װ", "����", "��׼�ĺ�","���","��Ӧ��"};
	dftm.setColumnIdentifiers(tableHeads);
	scrollPane.setViewportView(table);
}
 
开发者ID:Edward7Zhang,项目名称:SuperMarketManageSystem,代码行数:73,代码来源:XiaoShouPaiHang.java

示例7: GongYingShangChaXun

import javax.swing.JTable; //导入方法依赖的package包/类
public GongYingShangChaXun() {
	setMaximizable(true);
	setIconifiable(true);
	setClosable(true);
	setTitle("��Ӧ����Ϣ��ѯ");
	getContentPane().setLayout(new GridBagLayout());
	setBounds(100, 100, 609, 375);

	table = new JTable();
	table.setEnabled(false);
	table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	final DefaultTableModel dftm = (DefaultTableModel) table.getModel();
	String[] tableHeads = new String[]{"��Ӧ��ID", "��Ӧ��ȫ��", "���", "��������",
			"��ַ", "�绰", "����", "��ϵ��", "��ϵ�˵绰", "��������", "��������"};
	dftm.setColumnIdentifiers(tableHeads);

	final JScrollPane scrollPane = new JScrollPane(table);
	final GridBagConstraints gridBagConstraints_6 = new GridBagConstraints();
	gridBagConstraints_6.weighty = 1.0;
	gridBagConstraints_6.anchor = GridBagConstraints.NORTH;
	gridBagConstraints_6.insets = new Insets(0, 10, 0, 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);
	conditionName = new JComboBox();
	conditionName.setModel(new DefaultComboBoxModel(new String[]{"��Ӧ��ȫ��",
			"���"}));
	setupComponet(conditionName, 1, 0, 1, 30, true);

	conditionOperation = new JComboBox();
	conditionOperation.setModel(new DefaultComboBoxModel(new String[]{"����",
			"����"}));
	setupComponet(conditionOperation, 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));
	setupComponet(queryButton, 4, 0, 1, 1, false);
	queryButton.setText("��ѯ");

	final JButton showAllButton = new JButton();
	showAllButton.addActionListener(new ActionListener() {
		public void actionPerformed(final ActionEvent e) {
			conditionContent.setText("");
			List list = Dao.getGysInfos();
			updateTable(list, dftm);
		}
	});
	setupComponet(showAllButton, 5, 0, 1, 1, false);
	showAllButton.setText("��ʾȫ������");
}
 
开发者ID:Edward7Zhang,项目名称:SuperMarketManageSystem,代码行数:58,代码来源:GongYingShangChaXun.java


注:本文中的javax.swing.JTable.setEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。