use of javax.swing.JTable in project jmeter by apache.
the class SamplerResultTab method createResponseMetadataPanel.
private Component createResponseMetadataPanel() {
stats = new JTextPane();
stats.setEditable(false);
stats.setBackground(backGround);
// Add styles to use for different types of status messages
StyledDocument doc = (StyledDocument) stats.getDocument();
Style style = doc.addStyle(STYLE_REDIRECT, null);
StyleConstants.setForeground(style, REDIRECT_COLOR);
style = doc.addStyle(STYLE_CLIENT_ERROR, null);
StyleConstants.setForeground(style, CLIENT_ERROR_COLOR);
style = doc.addStyle(STYLE_SERVER_ERROR, null);
StyleConstants.setForeground(style, SERVER_ERROR_COLOR);
paneRaw = GuiUtils.makeScrollPane(stats);
paneRaw.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
// Set up the 1st table Result with empty headers
tableResult = new JTable(resultModel);
JMeterUtils.applyHiDPI(tableResult);
// $NON-NLS-1$
tableResult.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
tableResult.addMouseListener(new TextBoxDoubleClick(tableResult));
setFirstColumnPreferredSize(tableResult);
RendererUtils.applyRenderers(tableResult, RENDERERS_RESULT);
// Set up the 2nd table
tableResHeaders = new JTable(resHeadersModel);
JMeterUtils.applyHiDPI(tableResHeaders);
// $NON-NLS-1$
tableResHeaders.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
tableResHeaders.addMouseListener(new TextBoxDoubleClick(tableResHeaders));
setFirstColumnPreferredSize(tableResHeaders);
tableResHeaders.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
RendererUtils.applyRenderers(tableResHeaders, RENDERERS_HEADERS);
// Set up the 3rd table
tableResFields = new JTable(resFieldsModel);
JMeterUtils.applyHiDPI(tableResFields);
// $NON-NLS-1$
tableResFields.setToolTipText(JMeterUtils.getResString("textbox_tooltip_cell"));
tableResFields.addMouseListener(new TextBoxDoubleClick(tableResFields));
setFirstColumnPreferredSize(tableResFields);
tableResFields.getTableHeader().setDefaultRenderer(new HeaderAsPropertyRenderer());
RendererUtils.applyRenderers(tableResFields, RENDERERS_FIELDS);
// Prepare the Results tabbed pane
tabbedResult = new JTabbedPane(SwingConstants.BOTTOM);
// Create the split pane
JSplitPane topSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, GuiUtils.makeScrollPane(tableResHeaders), GuiUtils.makeScrollPane(tableResFields));
topSplit.setOneTouchExpandable(true);
// set split ratio
topSplit.setResizeWeight(0.80);
// see bug jdk 4131528
topSplit.setBorder(null);
paneParsed = new JSplitPane(JSplitPane.VERTICAL_SPLIT, GuiUtils.makeScrollPane(tableResult), topSplit);
paneParsed.setOneTouchExpandable(true);
// set split ratio
paneParsed.setResizeWeight(0.40);
// see bug jdk 4131528
paneParsed.setBorder(null);
// setup bottom tabs, first Raw, second Parsed
//$NON-NLS-1$
tabbedResult.addTab(JMeterUtils.getResString("view_results_table_result_tab_raw"), paneRaw);
//$NON-NLS-1$
tabbedResult.addTab(JMeterUtils.getResString("view_results_table_result_tab_parsed"), paneParsed);
// Hint to background color on bottom tabs (grey, not blue)
JPanel panel = new JPanel(new BorderLayout());
panel.add(tabbedResult);
return panel;
}
use of javax.swing.JTable in project jmeter by apache.
the class HTTPArgumentsPanel method init.
private void init() {
// WARNING: called from ctor so must not be overridden (i.e. must be private or final)
// register the right click menu
JTable table = getTable();
final JPopupMenu popupMenu = new JPopupMenu();
JMenuItem variabilizeItem = new JMenuItem(JMeterUtils.getResString("transform_into_variable"));
variabilizeItem.addActionListener(e -> transformNameIntoVariable());
popupMenu.add(variabilizeItem);
table.setComponentPopupMenu(popupMenu);
}
use of javax.swing.JTable in project joda-time by JodaOrg.
the class DateTimeBrowser method resetDefaults.
/*
* resetDefaults
*/
private void resetDefaults(TableView tView) {
Object[] colNames = tView.getColNames();
Object[][] tableValues = tView.getCalcdValues();
// dumpObjs( tableValues, System.out);
JTable table = new JTable(tableValues, colNames);
tView.setViewColumnsWidth(table);
setTitle(tView.getViewTitle());
//
if (mainSP != null)
getContentPane().remove(mainSP);
mainSP = new JScrollPane(table);
getContentPane().add(mainSP, "Center");
validate();
}
use of javax.swing.JTable in project jgnash by ccavanaugh.
the class MainRegisterPanel method columnAction.
private void columnAction() {
AbstractRegisterTableModel m = getActiveModel();
if (m != null) {
if (ColumnDialog.showDialog(m)) {
// save new column configuration
JTable t = getActiveTable();
if (t != null) {
JTableUtils.packTable(t);
}
saveCurrentRegisterLayout();
}
}
}
use of javax.swing.JTable in project jgnash by ccavanaugh.
the class AbstractRegisterPanel method autoScroll.
/**
* Must place at the end of the event list for this to work
*/
private void autoScroll() {
EventQueue.invokeLater(() -> {
final JTable table = getTable();
Rectangle cell = table.getCellRect(table.getRowCount() - 1, 0, true);
table.scrollRectToVisible(cell);
});
}
Aggregations