本文整理汇总了Java中javax.swing.JPanel.setAutoscrolls方法的典型用法代码示例。如果您正苦于以下问题:Java JPanel.setAutoscrolls方法的具体用法?Java JPanel.setAutoscrolls怎么用?Java JPanel.setAutoscrolls使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JPanel
的用法示例。
在下文中一共展示了JPanel.setAutoscrolls方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: erzeugeHauptPanel
import javax.swing.JPanel; //导入方法依赖的package包/类
/**
* 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);
}
示例2: erzeugeHauptPanel
import javax.swing.JPanel; //导入方法依赖的package包/类
/**
* 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);
}
示例3: DialogFrame
import javax.swing.JPanel; //导入方法依赖的package包/类
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();
}
示例4: ReadLogsWindow
import javax.swing.JPanel; //导入方法依赖的package包/类
/**
* 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);
}