本文整理汇总了Java中javax.swing.JScrollPane.setOpaque方法的典型用法代码示例。如果您正苦于以下问题:Java JScrollPane.setOpaque方法的具体用法?Java JScrollPane.setOpaque怎么用?Java JScrollPane.setOpaque使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JScrollPane
的用法示例。
在下文中一共展示了JScrollPane.setOpaque方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeMainLabel
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
* Creates the main text representation of this result.
*
* @param text
* @return
*/
private Component makeMainLabel(String text) {
JEditorPane label = new ExtendedHTMLJEditorPane("text/html", text);
StyleSheet css = ((HTMLEditorKit) label.getEditorKit()).getStyleSheet();
css.addRule("body {font-family:Sans;font-size:11pt}");
css.addRule("h3 {margin:0; padding:0}");
css.addRule("h4 {margin-bottom:0; margin-top:1ex; padding:0}");
css.addRule("p {margin-top:0; margin-bottom:1ex; padding:0}");
css.addRule("ul {margin-top:0; margin-bottom:1ex; list-style-image: url("
+ getClass().getResource("/com/rapidminer/resources/icons/modern/help/circle.png") + ")}");
css.addRule("ul li {padding-bottom: 2px}");
css.addRule("li.outPorts {padding-bottom: 0px}");
css.addRule("ul li ul {margin-top:0; margin-bottom:1ex; list-style-image: url("
+ getClass().getResource("/com/rapidminer/resources/icons/modern/help/line.png") + ")");
css.addRule("li ul li {padding-bottom:0}");
label.setEditable(false);
JScrollPane pane = new JScrollPane(label);
pane.setOpaque(false);
pane.setBackground(null);
pane.setBorder(null);
return pane;
}
示例2: LicenceJMenuItem
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
* Constructs
*
* @param objPcontrolJFrame
*/
public LicenceJMenuItem(ControlJFrame objPcontrolJFrame) {
this.objGcontrolJFrame = objPcontrolJFrame;
// Licence dialog :
this.objGlicenceJDialog = new JDialog(this.objGcontrolJFrame, this.objGcontrolJFrame.getLanguageString(Language.intS_TITLE_LICENCE), true);
final JTextArea objLlicenceJTextArea = new JTextArea();
objLlicenceJTextArea.setFont(new Font("Courier", Font.PLAIN, 11));
objLlicenceJTextArea.setOpaque(true);
objLlicenceJTextArea.setEditable(false);
final JScrollPane objLjScrollPane =
new JScrollPane(objLlicenceJTextArea,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
objLjScrollPane.setOpaque(true);
this.objGlicenceJDialog.add(objLjScrollPane);
this.objGlicenceJDialog.validate();
this.objGlicenceJDialog.pack();
this.objGlicenceJDialog.addWindowListener(new JDialogWindowListener(this.objGcontrolJFrame, this.objGlicenceJDialog, false));
this.setFont(this.objGcontrolJFrame.getFont());
this.setOpaque(true);
this.addActionListener(this);
this.setAccelerator(Constants.keyS_LICENCE);
}
示例3: handleTabSwitched
import javax.swing.JScrollPane; //导入方法依赖的package包/类
private void handleTabSwitched(String searchText, List<String> matchedKeywords) {
final int selectedIndex = tabbedPanel.getSelectedIndex() >= 0 ? tabbedPanel.getSelectedIndex() : -1;
if (selectedIndex != -1) {
String category = tabbedPanel.getTitleAt(selectedIndex);
if (tabbedPanel.getSelectedComponent() instanceof JLabel) {
JComponent panel = model.getPanel(category);
if( null == panel.getBorder() ) {
panel.setBorder(BorderFactory.createEmptyBorder(11,11,11,11));
}
JScrollPane scroll = new JScrollPane(panel);
scroll.setOpaque(false);
scroll.getViewport().setOpaque(false);
scroll.setBorder(BorderFactory.createEmptyBorder());
scroll.getVerticalScrollBar().setUnitIncrement(Utils.ScrollBarUnitIncrement);
scroll.getHorizontalScrollBar().setUnitIncrement(Utils.ScrollBarUnitIncrement);
tabbedPanel.setComponentAt(tabbedPanel.getSelectedIndex(), scroll);
}
model.update(category);
if (searchText != null && matchedKeywords != null) {
OptionsPanelController controller = model.getController(model.getID(category));
if(controller == null) {
LOGGER.log(Level.WARNING, "No controller found for category: {0}", category); //NOI18N
} else {
controller.handleSuccessfulSearch(searchText, matchedKeywords);
}
}
firePropertyChange (OptionsPanelController.PROP_HELP_CTX, null, null);
}
}
示例4: NewProcessCard
import javax.swing.JScrollPane; //导入方法依赖的package包/类
NewProcessCard(Window owner) {
this.setLayout(new BorderLayout());
this.setBackground(GettingStartedDialog.BACKGROUND_COLOR);
CardHeaderPanel header = new CardHeaderPanel("getting_started.header.templates");
this.add(header, "North");
this.processEntryList = new NewProcessEntryList(TemplateManager.INSTANCE.getAllTemplates(), owner);
JScrollPane centerPanel = new JScrollPane(this.processEntryList, 20, 31);
centerPanel.setBorder(null);
centerPanel.setOpaque(false);
centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 20, 20));
this.add(centerPanel, "Center");
}
示例5: initializeComponents
import javax.swing.JScrollPane; //导入方法依赖的package包/类
private void initializeComponents() {
filterBox = FilterLoader.getFilterBox();
fcp = getFilter().getSettingsPanel(setP.getRefreshable(), channel);
settingsPane= new JScrollPane(fcp);
settingsPane.setMinimumSize(new Dimension(fcp.getPreferredSize().width, Math.min(100, fcp.getMinimumSize().height)));
settingsPane.getViewport().setOpaque(false);
settingsPane.setBorder(BorderFactory.createEmptyBorder());
settingsPane.setOpaque(false);
}
示例6: getDevelopmentDialog
import javax.swing.JScrollPane; //导入方法依赖的package包/类
final private JDialog getDevelopmentDialog( ControlJFrame objPcontrolJFrame,
JTextArea objPdevelopmentJTextArea,
ExtendedJButton objPdevelopmentCloseExtendedJButton) {
// Development scrollpane :
final JScrollPane objLdevelopmentJScrollPane =
new JScrollPane(objPdevelopmentJTextArea,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
objLdevelopmentJScrollPane.setOpaque(true);
// Development dialog :
final JDialog objLdevelopmentJDialog =
new JDialog(objPcontrolJFrame,
objPcontrolJFrame.getLanguageString(Language.intS_TITLE_DEVELOPMENT),
true);
objLdevelopmentJDialog.setLayout(new GridBagLayout());
final ExtendedGridBagConstraints objLextendedGridBagConstraints =
new ExtendedGridBagConstraints( 0,
GridBagConstraints.RELATIVE,
1,
1,
GridBagConstraints.CENTER,
0,
0,
0,
10,
0,
0,
GridBagConstraints.BOTH,
1.0F,
1.0F);
// Add content :
objLdevelopmentJDialog.add(objLdevelopmentJScrollPane, objLextendedGridBagConstraints);
objLextendedGridBagConstraints.setFilling(GridBagConstraints.NONE, 0.0F, 0.0F);
objLdevelopmentJDialog.add(objPdevelopmentCloseExtendedJButton, objLextendedGridBagConstraints);
objLdevelopmentJDialog.addWindowListener(new JDialogWindowListener(objPcontrolJFrame, objLdevelopmentJDialog, false));
return objLdevelopmentJDialog;
}
示例7: 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);
}
示例8: 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);
}
示例9: handleTabSwitched
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/** Replace placeholder with real panel and change help context. */
private void handleTabSwitched(String searchText, List<String> matchedKeywords) {
final int selectedIndex = pane.getSelectedIndex();
if (selectedIndex != -1) {
String tabTitle = pane.getTitleAt(selectedIndex);
OptionsPanelController controller = tabTitle2controller.get(tabTitle);
if (pane.getSelectedComponent() instanceof JLabel) {
JComponent comp;
if (controller == null) {
AdvancedOption advancedOption = tabTitle2Option.get(tabTitle);
if (advancedOption == null) {
LOGGER.log(Level.INFO, "AdvancedOption for {0} is not present.", tabTitle);
return;
} else {
controller = advancedOption.create();
tabTitle2controller.put(tabTitle, controller);
// must be here because many controllers rely on fact that getComponent() is called first than other methods
comp = controller.getComponent(masterLookup);
// add existing listeners
for (PropertyChangeListener pcl : pcs.getPropertyChangeListeners()) {
controller.addPropertyChangeListener(pcl);
}
}
} else {
comp = controller.getComponent(masterLookup);
}
if( null == comp.getBorder() ) {
comp.setBorder(BorderFactory.createEmptyBorder(11,11,11,11));
}
JScrollPane scroll = new JScrollPane(comp);
scroll.setBorder(BorderFactory.createEmptyBorder());
scroll.setOpaque(false);
scroll.getViewport().setOpaque(false);
scroll.getVerticalScrollBar().setUnitIncrement(Utils.ScrollBarUnitIncrement);
scroll.getHorizontalScrollBar().setUnitIncrement(Utils.ScrollBarUnitIncrement);
pane.setComponentAt(selectedIndex, scroll);
controller.update();
controller.isValid();
}
if (searchText != null && matchedKeywords != null) {
controller.handleSuccessfulSearch(searchText, matchedKeywords);
}
pcs.firePropertyChange(OptionsPanelController.PROP_HELP_CTX, null, null);
}
}
示例10: listPanel
import javax.swing.JScrollPane; //导入方法依赖的package包/类
private Component listPanel() {
JScrollPane panelScroll = new JScrollPane();
panelScroll.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.BLACK, 2),
BorderFactory.createEmptyBorder(0, 10, 0, 0)));
panelScroll.setBackground(new Color(255, 155, 109));
panelScroll.setOpaque(true);
panelScroll.setPreferredSize(new Dimension(0, 250));
recordJList = new JList<>();
recordJList.addListSelectionListener(this);
recordModel = new DefaultListModel<>();
loadRecords();
recordJList.setModel(recordModel);
recordJList.setCellRenderer(new RecordAdapter());
panelScroll.setViewportView(recordJList);
return panelScroll;
}
示例11: doAddWidgets
import javax.swing.JScrollPane; //导入方法依赖的package包/类
final private void doAddWidgets() {
this.setLayout(new GridBagLayout());
final JScrollPane objLjScrollPane =
new JScrollPane(this.objGclipboardJTextArea,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
objLjScrollPane.setOpaque(true);
this.add(objLjScrollPane, new ExtendedGridBagConstraints( 0,
0,
1,
1,
GridBagConstraints.CENTER,
5,
0,
5,
5,
GridBagConstraints.BOTH,
1.0F,
1.0F));
final JPanel objLbuttonsJPanel = new JPanel();
objLbuttonsJPanel.setLayout(new BoxLayout(objLbuttonsJPanel, BoxLayout.LINE_AXIS));
objLbuttonsJPanel.setOpaque(true);
objLbuttonsJPanel.add(Box.createHorizontalGlue());
objLbuttonsJPanel.add(this.objGsimpleCopyJButton);
objLbuttonsJPanel.add(this.objGdetailedCopyJButton);
objLbuttonsJPanel.add(Box.createHorizontalGlue());
objLbuttonsJPanel.add(this.objGcopyClipboardJButton);
objLbuttonsJPanel.add(this.objGfreeClipboardJButton);
objLbuttonsJPanel.add(Box.createHorizontalGlue());
objLbuttonsJPanel.add(this.objGcloseClipboardJButton);
objLbuttonsJPanel.add(Box.createHorizontalGlue());
this.add(objLbuttonsJPanel, new ExtendedGridBagConstraints( 0,
1,
1,
1,
GridBagConstraints.CENTER,
10,
10,
10,
10,
GridBagConstraints.HORIZONTAL,
1.0F,
0.0F));
}
示例12: DataJFrame
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
* Constructs
*
* @param objPjuggleMasterPro
* @param intPballsNumber
*/
public DataJFrame(ControlJFrame objPcontrolJFrame, JuggleMasterPro objPjuggleMasterPro) {
this.objGcontrolJFrame = objPcontrolJFrame;
this.objGjuggleMasterPro = objPjuggleMasterPro;
this.bolGalreadyDisplayed = this.bolGvisible = false;
this.intGballsNumber = this.intGframeHeight = 0;
this.objGanimationJTable =
new DataJTable( this.objGcontrolJFrame,
this,
1,
DataJFrame.bytS_ANIMATION_TABLE_COLUMNS_NUMBER,
new Integer(0),
DataJFrame.intS_ANIMATION_TABLE_HEADER_LANGUAGE_INDEX_A,
DataJFrame.intS_ANIMATION_TABLE_HEADER_TOOLTIP_LANGUAGE_INDEX_A);
this.objGhandsAndBallsJTable =
new DataJTable( this.objGcontrolJFrame,
this,
2,
DataJFrame.bytS_HANDS_AND_BALLS_TABLE_COLUMNS_NUMBER,
DataJFrame.bytS_HANDS_AND_BALLS_TABLE_COLOR,
Strings.strS_EMPTY,
DataJFrame.intS_HANDS_AND_BALLS_TABLE_HEADER_LANGUAGE_INDEX_A,
DataJFrame.intS_HANDS_AND_BALLS_TABLE_HEADER_TOOLTIP_LANGUAGE_INDEX_A);
this.objGcontentAdjustmentJToggleButton = new DataJToggleButton(this, DataJToggleButton.bytS_CONTENT_ADJUSTMENT);
this.objGwindowAdjustmentJToggleButton = new DataJToggleButton(this, DataJToggleButton.bytS_WINDOW_ADJUSTMENT);
this.objGcloseWindowJToggleButton = new DataJToggleButton(this, DataJToggleButton.bytS_CLOSE_WINDOW);
this.setLayout(new GridBagLayout());
this.objGjPanel = new JPanel(new GridBagLayout());
this.objGjPanel.setOpaque(true);
final JScrollPane objLjScrollPane =
new JScrollPane(this.objGjPanel,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
objLjScrollPane.setOpaque(true);
this.add(objLjScrollPane, new ExtendedGridBagConstraints(0, 0, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, 1.0F, 1.0F));
this.setHandsAndBallsTableSize();
this.setHeaders();
this.setIconImage(this.objGjuggleMasterPro.getImage(Constants.intS_FILE_ICON_FRAME, Constants.bytS_UNCLASS_NO_VALUE));
this.setTitle(this.objGcontrolJFrame.getLanguageString(Language.intS_TITLE_DATA));
this.addWindowListener(this);
this.addComponentListener(this);
}
示例13: setTextArea
import javax.swing.JScrollPane; //导入方法依赖的package包/类
/**
* Method description
*
* @see
* @param bytPiOType
* @param bolPjMPFile
*/
private void setTextArea(byte bytPiOType, byte bytPfileExtension) {
final JTextArea objLjTextArea =
new JTextArea(25, Math.max( 135,
this.objGcontrolJFrame .getLanguageString(Language.intS_MESSAGE_SEPARATOR_LINE)
.length()));
switch (bytPiOType) {
case WriteFileJMenuItem.bytS_PATTERNS_FILE:
case WriteFileJMenuItem.bytS_SITESWAPS_FILE:
objLjTextArea.setText(this.objGcontrolJFrame.getPatternsManager()
.toFileString( Constants.bytS_UNCLASS_CURRENT,
bytPfileExtension,
true,
bytPiOType == WriteFileJMenuItem.bytS_PATTERNS_FILE,
true,
this.objGcontrolJFrame.objGobjectsJList.intGfilteredObjectIndexA,
this.objGcontrolJFrame.objGshortcutsJComboBox.intGfilteredShortcutIndexA,
this.objGcontrolJFrame.getLanguage()));
break;
case WriteFileJMenuItem.bytS_STYLES_FILE:
objLjTextArea.setText(this.objGcontrolJFrame.getPatternsManager().toFileString( Constants.bytS_UNCLASS_CURRENT,
bytPfileExtension,
false,
true,
false,
null,
null,
this.objGcontrolJFrame.getLanguage()));
break;
case WriteFileJMenuItem.bytS_NEW_PATTERNS_FILE:
objLjTextArea.setText(this.objGcontrolJFrame.getLanguageString(bytPfileExtension == Constants.bytS_EXTENSION_JMP
? Language.intS_MESSAGE_PATTERNS_JMP_FILE_HEADER
: bytPfileExtension == Constants.bytS_EXTENSION_JM
? Language.intS_MESSAGE_PATTERNS_JM_FILE_HEADER
: bytPfileExtension == Constants.bytS_EXTENSION_JAP
? Language.intS_MESSAGE_PATTERNS_JAP_FILE_HEADER
: Constants.bytS_UNCLASS_NO_VALUE));
break;
case WriteFileJMenuItem.bytS_NEW_LANGUAGE_FILE:
case WriteFileJMenuItem.bytS_NEW_EMPTY_LANGUAGE_FILE:
case WriteFileJMenuItem.bytS_NEW_DEFAULT_LANGUAGE_FILE:
objLjTextArea.setText(Language.getNewLanguageString(bytPiOType == WriteFileJMenuItem.bytS_NEW_DEFAULT_LANGUAGE_FILE));
break;
case WriteFileJMenuItem.bytS_CURRENT_LANGUAGE_FILE:
objLjTextArea.setText(this.objGcontrolJFrame.getLanguage().getLanguageString());
break;
}
objLjTextArea.setFont(new Font("Courier", Font.PLAIN, 11));
objLjTextArea.setCaretPosition(0);
objLjTextArea.setLineWrap(false);
objLjTextArea.setOpaque(true);
objLjTextArea.setEditable(false);
final JScrollPane objLscrollPane =
new JScrollPane(objLjTextArea,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
objLscrollPane.setOpaque(true);
objLscrollPane.setBorder(Constants.objS_GRAPHICS_JUGGLE_BORDER);
this.add(objLscrollPane);
this.validate();
this.pack();
}