本文整理匯總了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);
}