use of javax.swing.JScrollBar in project jmeter by apache.
the class ProxyControlGui method createTargetPanel.
private JPanel createTargetPanel() {
targetNodesModel = new DefaultComboBoxModel<>();
targetNodes = new JComboBox<>(targetNodesModel);
// $NON-NLS-1$ // Bug 56303 fixed the width of combo list
targetNodes.setPrototypeDisplayValue("");
// get popup element
JPopupMenu popup = (JPopupMenu) targetNodes.getUI().getAccessibleChild(targetNodes, 0);
JScrollPane scrollPane = findScrollPane(popup);
if (scrollPane != null) {
// add scroll pane if label element is too long
scrollPane.setHorizontalScrollBar(new JScrollBar(JScrollBar.HORIZONTAL));
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
}
targetNodes.setActionCommand(CHANGE_TARGET);
// Action listener will be added later
// $NON-NLS-1$
JLabel label = new JLabel(JMeterUtils.getResString("proxy_target"));
label.setLabelFor(targetNodes);
HorizontalPanel panel = new HorizontalPanel();
panel.add(label);
panel.add(targetNodes);
return panel;
}
use of javax.swing.JScrollBar in project felix by apache.
the class LogPanel method log.
/* public static void log(String msg) {
logArea.append(msg + "\n\r");
JScrollBar scrBar = scroll.getVerticalScrollBar();
int maxPos = scrBar.getMaximum();
scrBar.setValue(maxPos);
}*/
public static void log(final String msg) {
synchronized (logArea) {
logArea.append(msg);
logArea.append("\n\r");
}
JScrollBar scrBar = scroll.getVerticalScrollBar();
int maxPos = scrBar.getMaximum();
scrBar.setValue(maxPos);
}
use of javax.swing.JScrollBar in project omegat by omegat-org.
the class PreferencesWindowController method adjustTreeSize.
private void adjustTreeSize() {
JScrollBar hScrollBar = innerPanel.availablePrefsScrollPane.getHorizontalScrollBar();
if (hScrollBar != null) {
int currentWidth = innerPanel.availablePrefsScrollPane.getViewport().getWidth();
int preferredWidth = hScrollBar.getMaximum();
if (preferredWidth > currentWidth) {
int newWidth = innerPanel.leftPanel.getWidth() + (preferredWidth - currentWidth);
innerPanel.leftPanel.setMinimumSize(new Dimension(newWidth, 0));
innerPanel.mainSplitPane.setDividerLocation(-1);
}
}
}
use of javax.swing.JScrollBar in project omegat by omegat-org.
the class AutoCompleterListView method getPreferredWidth.
@Override
public int getPreferredWidth() {
int width = getList().getPreferredSize().width;
JScrollBar bar = completer.scroll.getVerticalScrollBar();
if (bar != null) {
width += bar.getPreferredSize().width;
}
return width;
}
use of javax.swing.JScrollBar in project omegat by omegat-org.
the class ProjectFilesListController method propagateTableColumns.
private void propagateTableColumns() {
// Set last column of tableTotal to match size of scrollbar.
JScrollBar scrollbar = list.scrollFiles.getVerticalScrollBar();
int sbWidth = scrollbar == null || !scrollbar.isVisible() ? 0 : scrollbar.getWidth();
list.tableTotal.getColumnModel().getColumn(TotalsTableColumn.MARGIN.index).setPreferredWidth(sbWidth);
// Propagate column sizes to totals table
for (int i = 0; i < list.tableFiles.getColumnCount(); i++) {
TableColumn srcCol = list.tableFiles.getColumnModel().getColumn(i);
TableColumn trgCol = list.tableTotal.getColumnModel().getColumn(i);
trgCol.setPreferredWidth(srcCol.getWidth());
}
}
Aggregations