Java Code Examples for javax.swing.JPanel.setAutoscrolls()

The following are Jave code examples for showing how to use setAutoscrolls() of the javax.swing.JPanel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: SE2Project   File: AusleiheUI.java   View Source Code Vote up 5 votes
/**
 * Erzeugt das Hauptpanel, in das die Auflister und Materialanzeiger gepackt
 * werden.
 */
private void erzeugeHauptPanel()
{
    _hauptPanel = new JPanel();
    _hauptPanel.setLayout(new BorderLayout());
    setNoSize(_hauptPanel);
    _hauptPanel.setAutoscrolls(true);
    _hauptPanel.setBackground(UIConstants.BACKGROUND_COLOR);
}
 
Example 2
Project: SE2Project   File: VormerkUI.java   View Source Code Vote up 5 votes
/**
 * Erzeugt das Hauptpanel, in das die Auflister und Materialanzeiger gepackt
 * werden.
 */
private void erzeugeHauptPanel()
{
    _hauptPanel = new JPanel();
    _hauptPanel.setLayout(new BorderLayout());
    setNoSize(_hauptPanel);
    _hauptPanel.setAutoscrolls(true);
    _hauptPanel.setBackground(UIConstants.BACKGROUND_COLOR);
}
 
Example 3
Project: SE2Project   File: RueckgabeUI.java   View Source Code Vote up 5 votes
/**
 * Erzeugt das Hauptpanel, in dem sich Verleihkartenauflister,
 * Verleihkartenanzeiger und Rücknahme-Button befinden.
 */
private void erzeugeHauptPanel()
{
    _hauptPanel = new JPanel();
    _hauptPanel.setLayout(new BorderLayout());
    _hauptPanel.setPreferredSize(new java.awt.Dimension(-1, -1));
    _hauptPanel.setSize(-1, -1);
    _hauptPanel.setAutoscrolls(true);
    _hauptPanel.setBackground(UIConstants.BACKGROUND_COLOR);
}
 
Example 4
Project: Hotel-Properties-Management-System   File: DialogFrame.java   View Source Code Vote up 4 votes
public DialogFrame() {
	
	setType(Type.POPUP);
	setResizable(false);
	
	setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
	this.setTitle("Approving question");
	this.setPreferredSize(new Dimension(400, 190));
	this.setAlwaysOnTop(isAlwaysOnTopSupported());
	this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	getContentPane().setLayout(new BorderLayout());
	
	final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	
	this.setLocation(screenSize.width / 2 - 150, screenSize.height / 2 - 75);
	
	this.setIconImage(Toolkit.getDefaultToolkit().
			getImage(getClass().getResource(LOGOPATH)));
	
	final JPanel panel = new JPanel();
	panel.setAutoscrolls(true);
	getContentPane().add(panel, BorderLayout.CENTER);
	panel.setLayout(null);
	
	btnYes = new JButton("YES");
	btnYes.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
	btnYes.setBounds(291, 129, 91, 29);
	panel.add(btnYes);
	
	btnNo = new JButton("NO");
	btnNo.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
	btnNo.setBounds(199, 129, 91, 29);
	panel.add(btnNo);
	
	lblIcon = new JLabel("");
	lblIcon.setIcon(new ImageIcon(DialogFrame.class.getResource("/com/coder/hms/icons/dialogPane_question.png")));
	lblIcon.setBounds(14, 40, 69, 70);
	panel.add(lblIcon);
	
	
	textArea = new JTextArea();
	textArea.setDisabledTextColor(new Color(153, 204, 255));
	textArea.setBounds(95, 32, 287, 85);
	textArea.setBackground(UIManager.getColor("ComboBox.background"));
	textArea.setBorder(null);
	textArea.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
	textArea.setEditable(false);
	textArea.setFont(new Font("Monospaced", Font.PLAIN, 14));
	textArea.setLineWrap(true);
	panel.add(textArea);
	
	this.pack();
}
 
Example 5
Project: Hotel-Properties-Management-System   File: ReadLogsWindow.java   View Source Code Vote up 4 votes
/**
 * Create the frame.
 */
public ReadLogsWindow() {
	
	setTitle("Coder HPMSA - [Read Logs]");
	setBounds(100, 100, 660, 550);
	setBackground(Color.decode("#066d95"));
	setLocationRelativeTo(null);
	setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	
	this.setIconImage(Toolkit.getDefaultToolkit().
			getImage(getClass().getResource(LOGOPATH)));
	
	final JScrollPane scrollPane = new JScrollPane();
	scrollPane.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
	getContentPane().add(scrollPane, BorderLayout.CENTER);
	
	editorPane = new JTextPane();
	editorPane.setBackground(new Color(255, 255, 240));
	editorPane.setFont(new Font("Verdana", Font.PLAIN, 13));
	editorPane.setBorder(new EtchedBorder(EtchedBorder.RAISED, null, null));
	editorPane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
	editorPane.setEditable(false);
	scrollPane.setViewportView(editorPane);
	
	final JPanel filesPanel = new JPanel();
	filesPanel.setPreferredSize(new Dimension(200, 10));
	getContentPane().add(filesPanel, BorderLayout.EAST);
	filesPanel.setLayout(new BorderLayout(0, 0));
	
	final JScrollPane listScrollPane = new JScrollPane();
	listScrollPane.setBorder(new SoftBevelBorder(BevelBorder.LOWERED, null, null, null, null));
	listScrollPane.setViewportView(logFilesList());
	filesPanel.add(listScrollPane, BorderLayout.CENTER);
	
	final JPanel titlePanel = new JPanel();
	titlePanel.setPreferredSize(new Dimension(10, 40));
	titlePanel.setBackground(Color.decode("#066d95"));
	titlePanel.setAutoscrolls(true);
	getContentPane().add(titlePanel, BorderLayout.NORTH);
	titlePanel.setLayout(new BorderLayout(0, 0));
	
	final JLabel lblTitle = new JLabel("SYSTEM LOG RECORDS");
	lblTitle.setHorizontalTextPosition(SwingConstants.CENTER);
	lblTitle.setHorizontalAlignment(SwingConstants.CENTER);
	lblTitle.setAutoscrolls(true);
	lblTitle.setFont(new Font("Verdana", Font.BOLD, 25));
	lblTitle.setForeground(UIManager.getColor("Button.highlight"));
	titlePanel.add(lblTitle, BorderLayout.CENTER);
	
	final StyledDocument doc = editorPane.getStyledDocument();
	final SimpleAttributeSet center = new SimpleAttributeSet();
	StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
	doc.setParagraphAttributes(0, doc.getLength(), center, false);
	
	setVisible(true);
}