本文整理匯總了Java中javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED屬性的典型用法代碼示例。如果您正苦於以下問題:Java ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED屬性的具體用法?Java ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED怎麽用?Java ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javax.swing.ScrollPaneConstants
的用法示例。
在下文中一共展示了ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: LicenceJMenuItem
/**
* 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);
}
示例2: initComponents
private void initComponents() {
setLayout(new BorderLayout(5, 5));
this.setBorder(new EmptyBorder(20, 20, 20, 20));
//classesList = new JList(new StationsListModel());
stationsList = new JList();
stationsList.setListData(stationData.getStationKeys());
stationsList.setCellRenderer(new StationElementRenderer());
stationsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
panelDescription = new JLabel(STATIONS_PAR_DESCRIPTION);
JScrollPane jsp = new JScrollPane(stationsList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jsp.setPreferredSize(new Dimension(140, 200));
add(panelDescription, BorderLayout.NORTH);
add(jsp, BorderLayout.WEST);
stationsList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
updateParsPane();
}
});
}
示例3: DispQQPlotMatrix
public DispQQPlotMatrix(ModelWorkloadAnalysis m, int clustering) {
super(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.model = m;
this.setPreferredSize(new Dimension(420, 420));
panel = new DispersionPanel(model);
panel.setPreferredSize(new Dimension(DispersionPanel.WIDTH_TOT * model.getMatrix().getNumVariables(), DispersionPanel.HEIGHT_TOT
* model.getMatrix().getNumVariables()));
this.setViewportView(panel);
addListener();
}
示例4: DispKMeanMatrix
public DispKMeanMatrix(WorkloadAnalysisSession session, int clustering) {
/* Richiamo il costruttore della classe JScorllPanel impostando le barre di scorrimento solo se necessarie */
super(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.model = (ModelWorkloadAnalysis) session.getDataModel();
this.session = session;
/* Settaggio delle proprieta' del pannello di scroll */
this.setPreferredSize(new Dimension(420, 420));
/* Creazione e aggiunta del Pannello di visualizzazione della matrice di dispersione */
panel = new DispersionPanel(model, clustering);
panel.setPreferredSize(new Dimension(DispersionPanel.WIDTH_TOT * model.getMatrix().getNumVariables(), DispersionPanel.HEIGHT_TOT
* model.getMatrix().getNumVariables()));
this.setViewportView(panel);
}
示例5: DispMatrix
public DispMatrix(ModelWorkloadAnalysis m) {
/* Richiamo il costruttore della classe JScorllPanel impostando le barre di scorrimento solo se necessarie */
super(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.model = m;
/* Settaggio delle proprieta' del pannello di scroll */
this.setPreferredSize(new Dimension(420, 420));
/* Creazione e aggiunta del Pannello di visualizzazione della matrice di dispersione */
panel = new DispersionPanel(model);
panel.setPreferredSize(new Dimension(DispersionPanel.WIDTH_TOT * model.getMatrix().getNumVariables(), DispersionPanel.HEIGHT_TOT
* model.getMatrix().getNumVariables()));
this.setViewportView(panel);
addListener();
}
示例6: getUpperTable
private JScrollPane getUpperTable() {
clusteringFinalTable = new JTable(new clustDetModel(infos.numElem, infos.percent));
clusteringFinalTable.setSelectionBackground(new Color(83, 126, 126));
clusteringFinalTable.setSelectionForeground(Color.BLACK);
clusteringFinalTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
return new JScrollPane(clusteringFinalTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}
示例7: initComponents
private void initComponents() {
setLayout(new BorderLayout(5, 5));
this.setBorder(new EmptyBorder(20, 20, 20, 20));
//classesList = new JList(new StationsListModel());
stationsList = new JList();
stationsList.setListData(stationData.getStationKeys());
stationsList.setCellRenderer(new StationElementRenderer());
stationsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
panelDescription = new JLabel(STATIONS_PAR_DESCRIPTION);
JScrollPane jsp = new JScrollPane(stationsList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jsp.setPreferredSize(new Dimension(140, 200));
add(panelDescription, BorderLayout.NORTH);
add(jsp, BorderLayout.WEST);
stationsList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting()) {
return;
}
updateParsPane();
}
});
}
示例8: PacketDetailPanel
/**
* Constructor
* @param services
*/
@SuppressWarnings("serial")
public PacketDetailPanel(final ServiceFactory services) {
super(services);
setPreferredSize(new Dimension(getPreferredSize().width, 250));
_details = new JTextPane() {
@Override
public boolean getScrollableTracksViewportWidth() {
return getUI().getPreferredSize(this).width <= getParent().getSize().width;
}
};
final JScrollPane scroll = new JScrollPane(_details, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
add(scroll, BorderLayout.CENTER);
}
示例9: ScrollPanel
public ScrollPanel(LogFrame frame) {
super(frame);
this.table = new TablePanel(frame);
JScrollPane pane = new JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
pane.setVerticalScrollBar(table.getVerticalScrollBar());
setLayout(new BorderLayout());
add(pane);
}
示例10: editWindow
public int editWindow() {
this.drawing = new PlaRomPanel(this);
panel = new JScrollPane(this.drawing, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
panel.setBorder(null);
if (this.drawing.getPreferredSize().getWidth() >= (int) (screenSize.width * 0.75))
panel.setPreferredSize(
new Dimension((int) (screenSize.width * 0.75), (int) panel.getPreferredSize().getHeight()));
if (this.drawing.getPreferredSize().getHeight() >= (int) (screenSize.height * 0.75))
panel.setPreferredSize(
new Dimension((int) panel.getPreferredSize().getWidth(), (int) (screenSize.height * 0.75)));
return JOptionPane.showOptionDialog(null, panel, Strings.getter("ProgrammableGeneratorComponent").get(),
JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, this.options, null);
}
示例11: doAddWidgets
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
/**
* 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: DispFuzzyMatrix
public DispFuzzyMatrix() {
super(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
this.setPreferredSize(new Dimension(420, 420));
panel = new DispersionPanel();
this.setViewportView(panel);
}
示例14: LogWindow
/**
* Constructor
*/
public LogWindow(final Window parent) {
super(parent, "Log", ModalityType.DOCUMENT_MODAL);
final LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
for (final ch.qos.logback.classic.Logger logger : context.getLoggerList()) {
for (final Iterator<ch.qos.logback.core.Appender<ILoggingEvent>> index = logger.iteratorForAppenders(); index.hasNext();) {
final ch.qos.logback.core.Appender<ILoggingEvent> appender = index.next();
if (appender instanceof Appender) {
_appender = (Appender) appender;
break;
}
}
}
_logs = new JTextPane() {
@Override
public boolean getScrollableTracksViewportWidth() {
return getUI().getPreferredSize(this).width <= getParent().getSize().width;
}
};
if (_appender != null) {
_appender.display = this;
}
try {
for (final String line : Util.readUTF8File(new FileInputStream(Env.LOG_FILE))) {
appendFormatted(line + "\n");
}
} catch (final FileNotFoundException e1) {
appendFormatted("Failed to open file " + Env.LOG_FILE.getAbsolutePath());
}
final JScrollPane scroll = new JScrollPane(_logs, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scroll.setPreferredSize(new Dimension(800, 600));
getContentPane().add(scroll, BorderLayout.CENTER);
final JButton close = new JButton(Resources.getLabel("close.button"));
close.addActionListener(e -> LogWindow.this.dispose());
getContentPane().add(close, BorderLayout.SOUTH);
SwingUtilities4.setUp(this);
getRootPane().registerKeyboardAction(e -> {
_appender.display = null;
dispose();
if (parent != null) {
parent.toFront();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
}
示例15: setTextArea
/**
* 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();
}