本文整理汇总了Java中javax.swing.JScrollPane.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java JScrollPane.setVisible方法的具体用法?Java JScrollPane.setVisible怎么用?Java JScrollPane.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JScrollPane
的用法示例。
在下文中一共展示了JScrollPane.setVisible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initBoutonAjouter
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
* initialisation du panneaux contenant les boutons qui permettent d'ajouter
* une personne
*/
private void initBoutonAjouter() {
JPanel panneauChamp = new JPanel();
panneauChamp.setLayout(new BoxLayout(panneauChamp, BoxLayout.LINE_AXIS));
panneauChamp.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
JScrollPane pane = new JScrollPane(panneauChamp);
this.add(pane, BorderLayout.EAST);
pane.setVisible(true);
panneauChamp.add(Box.createHorizontalGlue());
panneauChamp.add(new JLabel("Nom : "));
panneauChamp.add(Box.createRigidArea(new Dimension(5, 0)));
this.nom = new JTextField(5);
panneauChamp.add(nom);
panneauChamp.add(Box.createRigidArea(new Dimension(10, 0)));
panneauChamp.add(new JLabel("Prenom : "));
panneauChamp.add(Box.createRigidArea(new Dimension(5, 0)));
this.prenom = new JTextField(5);
panneauChamp.add(prenom);
panneauChamp.add(Box.createRigidArea(new Dimension(10, 0)));
panneauChamp.add(new JLabel("Fonction : "));
panneauChamp.add(Box.createRigidArea(new Dimension(5, 0)));
this.fonction = new JTextField(10);
panneauChamp.add(fonction);
panneauChamp.add(Box.createRigidArea(new Dimension(20, 0)));
panneauChamp.add(new JButton(new ActionAjouterPersonne()));
this.add(panneauChamp);
}
示例2: mxCellEditor
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
*
*/
public mxCellEditor(mxGraphComponent graphComponent)
{
this.graphComponent = graphComponent;
// Creates the plain text editor
textArea = new JTextArea();
textArea.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
textArea.setOpaque(false);
// Creates the HTML editor
editorPane = new JEditorPane();
editorPane.setOpaque(false);
editorPane.setBackground(new Color(0,0,0,0));
editorPane.setContentType("text/html");
// Workaround for inserted linefeeds in HTML markup with
// lines that are longar than 80 chars
editorPane.setEditorKit(new NoLinefeedHtmlEditorKit());
// Creates the scollpane that contains the editor
// FIXME: Cursor not visible when scrolling
scrollPane = new JScrollPane();
scrollPane.setBorder(BorderFactory.createEmptyBorder());
scrollPane.getViewport().setOpaque(false);
scrollPane.setVisible(false);
scrollPane.setOpaque(false);
// Installs custom actions
editorPane.getActionMap().put(CANCEL_EDITING, cancelEditingAction);
textArea.getActionMap().put(CANCEL_EDITING, cancelEditingAction);
editorPane.getActionMap().put(SUBMIT_TEXT, textSubmitAction);
textArea.getActionMap().put(SUBMIT_TEXT, textSubmitAction);
// Remembers the action map key for the enter keystroke
editorEnterActionMapKey = editorPane.getInputMap().get(enterKeystroke);
textEnterActionMapKey = editorPane.getInputMap().get(enterKeystroke);
}
示例3: mxCellEditor
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
*
*/
public mxCellEditor(mxGraphComponent graphComponent) {
this.graphComponent = graphComponent;
// Creates the plain text editor
textArea = new JTextArea();
textArea.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
textArea.setOpaque(false);
// Creates the HTML editor
editorPane = new JEditorPane();
editorPane.setOpaque(false);
editorPane.setBackground(new Color(0, 0, 0, 0));
editorPane.setContentType("text/html");
// Workaround for inserted linefeeds in HTML markup with
// lines that are longar than 80 chars
editorPane.setEditorKit(new NoLinefeedHtmlEditorKit());
// Creates the scollpane that contains the editor
// FIXME: Cursor not visible when scrolling
scrollPane = new JScrollPane();
scrollPane.setBorder(BorderFactory.createEmptyBorder());
scrollPane.getViewport().setOpaque(false);
scrollPane.setVisible(false);
scrollPane.setOpaque(false);
// Installs custom actions
editorPane.getActionMap().put(CANCEL_EDITING, cancelEditingAction);
textArea.getActionMap().put(CANCEL_EDITING, cancelEditingAction);
editorPane.getActionMap().put(SUBMIT_TEXT, textSubmitAction);
textArea.getActionMap().put(SUBMIT_TEXT, textSubmitAction);
// Remembers the action map key for the enter keystroke
editorEnterActionMapKey = editorPane.getInputMap().get(enterKeystroke);
textEnterActionMapKey = editorPane.getInputMap().get(enterKeystroke);
}