Java Code Examples for javax.swing.JTable#setBounds()

The following examples show how to use javax.swing.JTable#setBounds() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GuiShowGoalDescriptionOverviewAction.java    From WorldGrower with GNU General Public License v3.0 7 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	JFrame frame = new JFrame();
	
	JTable table = new JTable(new GoalModel());
	table.setRowHeight(50);
	table.setBounds(50, 50, 400, 700);
	frame.add(new JScrollPane(table));

	frame.setBounds(100,  100, 500, 800);
	frame.setVisible(true);
}
 
Example 2
Source File: GuiShowBuildingsOverviewAction.java    From WorldGrower with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	WorldModel tableModel = new WorldModel(world);
	JFrame frame = new JFrame("Buildings count: " + tableModel.getRowCount());
	
	JTable table = new JTable(tableModel);
	table.setBounds(50, 50, 400, 700);
	table.setAutoCreateRowSorter(true);
	table.getRowSorter().toggleSortOrder(1);
	frame.add(new JScrollPane(table));
	
	frame.setBounds(100,  100, 500, 800);
	frame.setVisible(true);
}
 
Example 3
Source File: GuiShowThrownOutOfGroupEventsAction.java    From WorldGrower with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	JFrame frame = new JFrame();
	
	JTable table = new JTable(new WorldModel());
	table.getColumnModel().getColumn(0).setCellRenderer(new TooltipCellRenderer());
	table.setBounds(50, 50, 1000, 800);
	frame.add(new JScrollPane(table));
	
	frame.setBounds(100,  100, 900, 900);
	frame.setVisible(true);
}
 
Example 4
Source File: GuiShowSkillOverviewAction.java    From WorldGrower with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	JFrame frame = new JFrame();
	
	JTable table = new JTable(new WorldModel(world));
	table.setBounds(50, 50, 1000, 700);
	table.getColumnModel().getColumn(4).setCellRenderer(new TooltipCellRenderer());
	frame.add(new JScrollPane(table));
	
	frame.setBounds(100,  100, 800, 800);
	frame.setVisible(true);
}
 
Example 5
Source File: GuiShowImagesOverviewAction.java    From WorldGrower with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	JFrame frame = new JFrame();
	
	JTable table = new JTable(new ImageModel(Arrays.asList(ImageIds.values())));
	table.setBounds(50, 50, 1000, 800);
	table.setRowHeight(100);
	ImageCellRenderer renderer = new ImageCellRenderer(imageInfoReader);
	table.setDefaultRenderer(ImageIcon.class, renderer);
	frame.add(new JScrollPane(table));
	
	frame.setBounds(100,  100, 900, 900);
	frame.setVisible(true);
	
	Timer timer = new Timer();
	timer.schedule(new TimerTask() {
		
		@Override
		public void run() {
			renderer.incrementImageIndex();
			table.repaint();
		}
	}, 0, 100);
}
 
Example 6
Source File: GuiShowElectionResultsAction.java    From WorldGrower with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	JFrame frame = new JFrame();
	
	JTable table = new JTable(new WorldModel());
	table.getColumnModel().getColumn(0).setCellRenderer(new TooltipCellRenderer());
	table.setBounds(50, 50, 1000, 800);
	frame.add(new JScrollPane(table));
	
	frame.setBounds(100,  100, 900, 900);
	frame.setVisible(true);
}
 
Example 7
Source File: GuiShowPerformedActionsAction.java    From WorldGrower with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	JFrame frame = new JFrame();
	
	JTable table = new JTable(new WorldModel(world));
	table.setAutoCreateRowSorter(true);
	table.setBounds(50, 50, 400, 700);
	frame.add(new JScrollPane(table));
	
	frame.setBounds(100,  100, 500, 800);
	frame.setVisible(true);
}
 
Example 8
Source File: GuiShowPersonalitiesOverviewAction.java    From WorldGrower with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	JFrame frame = new JFrame();
	
	JTable table = new JTable(new WorldModel(world));
	table.setBounds(50, 50, 700, 700);
	for(int i=1; i<table.getColumnCount() -1; i++) {
		table.getColumnModel().getColumn(i).setPreferredWidth(10);
	}		
	table.getColumnModel().getColumn(table.getColumnCount() -1).setPreferredWidth(600);
	table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	
	
	frame.add(new JScrollPane(table));
	
	frame.setBounds(100,  100, 800, 800);
	frame.setVisible(true);
}
 
Example 9
Source File: GuiShowReasonsOverviewAction.java    From WorldGrower with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	JFrame frame = new JFrame();
	
	JTable table = new JTable(new WorldModel(world));
	table.setBounds(50, 50, 700, 700);
	table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
	
	
	frame.add(new JScrollPane(table));
	
	frame.setBounds(100,  100, 800, 800);
	frame.setVisible(true);
}