本文整理汇总了Java中ca.sqlpower.swingui.JDefaultButton类的典型用法代码示例。如果您正苦于以下问题:Java JDefaultButton类的具体用法?Java JDefaultButton怎么用?Java JDefaultButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JDefaultButton类属于ca.sqlpower.swingui包,在下文中一共展示了JDefaultButton类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CommonWordsFinderPanel
import ca.sqlpower.swingui.JDefaultButton; //导入依赖的package包/类
public CommonWordsFinderPanel(final MatchMakerSwingSession session, SPDataSource defaultConnection) {
this.session = session;
DataSourceCollection dataSources = session.getContext().getPlDotIni();
final JComboBox connectionChooser = new JComboBox(new ConnectionComboBoxModel(dataSources));
connectionChooser.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
JDBCDataSource ds = (JDBCDataSource) connectionChooser.getSelectedItem();
// Gets the session's shared SQLDatabase for this data source
SQLDatabase db = session.getDatabase(ds);
// XXX don't know if this is going to reparent the shared database in a bad way!
SQLObjectRoot root = new SQLObjectRoot();
root.addChild(db);
DBTreeModel model = new DBTreeModel(root);
columnPicker.setModel(model);
} catch (SQLObjectException ex) {
throw new RuntimeException(ex);
}
}
});
columnPicker = new JTree();
DefaultFormBuilder builder = new DefaultFormBuilder(
new FormLayout("pref:grow"));
builder.append("Choose a column to analyze for frequently-occurring words:");
builder.append(connectionChooser);
builder.append(new JScrollPane(columnPicker));
JDefaultButton okButton = new JDefaultButton("Start");
JButton cancelButton = new JButton("Cancel");
builder.append(ButtonBarFactory.buildOKCancelBar(okButton, cancelButton));
panel = builder.getPanel();
}
示例2: actionPerformed
import ca.sqlpower.swingui.JDefaultButton; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
try {
dialog = SPSUtils.makeOwnedDialog(getPanel(), "Select Graph Display Values");
if (chooser == null) {
chooser = new DisplayedNodeValueChooser((SourceTableNodeRenderer) graph.getNodeRenderer(), project, displayColumns);
}
revertList = chooser.getChosenColumns();
JDefaultButton okButton = new JDefaultButton(okAction);
JPanel buttonPanelRight = ButtonBarFactory.buildOKCancelBar(okButton, new JButton(cancelAction));
JPanel buttonPanelLeft = ButtonBarFactory.buildLeftAlignedBar(new JButton(selectAction),
new JButton(deselectAction));
JPanel buttonPanel = new JPanel(new BorderLayout());
buttonPanel.add(buttonPanelLeft, BorderLayout.WEST);
buttonPanel.add(buttonPanelRight, BorderLayout.EAST);
JPanel panel = new JPanel(new BorderLayout());
panel.add(chooser.makeGUI(), BorderLayout.CENTER);
panel.add(buttonPanel, BorderLayout.SOUTH);
dialog.getContentPane().add(panel);
dialog.pack();
dialog.getRootPane().setDefaultButton(okButton);
SPSUtils.makeJDialogCancellable(dialog, cancelAction, false);
dialog.setLocationRelativeTo((Component) e.getSource());
dialog.setVisible(true);
} catch (SQLObjectException ex) {
MMSUtils.showExceptionDialog((Component) e.getSource(), ex.getMessage(), ex);
}
}