Java Code Examples for java.awt.Canvas#setMaximumSize()

The following examples show how to use java.awt.Canvas#setMaximumSize() . 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: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}
 
Example 2
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	
	frame.add(canvas);
	frame.pack();
}
 
Example 3
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	
	frame.add(canvas);
	frame.pack();
}
 
Example 4
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}
 
Example 5
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	
	frame.add(canvas);
	frame.pack();
}
 
Example 6
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}
 
Example 7
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	
	frame.add(canvas);
	frame.pack();
}
 
Example 8
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	
	frame.add(canvas);
	frame.pack();
}
 
Example 9
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}
 
Example 10
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}
 
Example 11
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}
 
Example 12
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	
	frame.add(canvas);
	frame.pack();
}
 
Example 13
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	
	frame.add(canvas);
	frame.pack();
}
 
Example 14
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	
	frame.add(canvas);
	frame.pack();
}
 
Example 15
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}
 
Example 16
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	
	frame.add(canvas);
	frame.pack();
}
 
Example 17
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}
 
Example 18
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 6 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}
 
Example 19
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}
 
Example 20
Source File: Display.java    From New-Beginner-Java-Game-Programming-Src with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
private void createDisplay(){
	frame = new JFrame(title);
	frame.setSize(width, height);
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setResizable(false);
	frame.setLocationRelativeTo(null);
	frame.setVisible(true);
	
	canvas = new Canvas();
	canvas.setPreferredSize(new Dimension(width, height));
	canvas.setMaximumSize(new Dimension(width, height));
	canvas.setMinimumSize(new Dimension(width, height));
	canvas.setFocusable(false);
	
	frame.add(canvas);
	frame.pack();
}