本文整理汇总了Java中javax.swing.JTabbedPane.setBorder方法的典型用法代码示例。如果您正苦于以下问题:Java JTabbedPane.setBorder方法的具体用法?Java JTabbedPane.setBorder怎么用?Java JTabbedPane.setBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTabbedPane
的用法示例。
在下文中一共展示了JTabbedPane.setBorder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initComponents
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private void initComponents() {
this.setLayout(new BorderLayout(5, 5));
mainPanel = new JTabbedPane();
mainPanel.setBorder(title);
// Adds a change listener to perform gotFocus() and lostFocus() calls on wizardPanels
mainPanel.addChangeListener(new ChangeListener() {
/**
* Invoked when the target of the listener has changed its state.
*
* @param e a ChangeEvent object
*/
public void stateChanged(ChangeEvent e) {
// Lose focus on old panel
if (current != null) {
current.lostFocus();
}
// gets focus on new panel
if (mainPanel.getSelectedComponent() != null) {
current = (WizardPanel) mainPanel.getSelectedComponent();
current.gotFocus();
}
}
});
add(mainPanel, BorderLayout.CENTER);
}
示例2: initComponents
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
private void initComponents() {
this.setLayout(new BorderLayout(5, 5));
mainPanel = new JTabbedPane();
mainPanel.setBorder(title);
// Adds a change listener to perform gotFocus() and lostFocus() calls on wizardPanels
mainPanel.addChangeListener(new ChangeListener() {
/**
* Invoked when the target of the listener has changed its state.
*
* @param e a ChangeEvent object
*/
public void stateChanged(ChangeEvent e) {
// Lose focus on old panel
if (current != null) {
current.lostFocus();
}
// gets focus on new panel
if (mainPanel.getSelectedComponent() != null) {
current = (WizardPanel) mainPanel.getSelectedComponent();
current.gotFocus();
}
}
});
add(mainPanel, BorderLayout.CENTER);
}
示例3: SyncSinkFrame
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public SyncSinkFrame(){
super("SyncSink");
logTextField = new JTextArea();
logTextField.setEditable(false);
DefaultCaret caret = (DefaultCaret)logTextField.getCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
StringBuilder sb = new StringBuilder();
sb.append("----------------------------------------\n");
sb.append("Configuration currently in use: \n");
for(Key key : Key.values()){
sb.append("\t");
sb.append(key.name());
sb.append("=");
sb.append(Config.get(key));
sb.append("\n");
}
sb.append("----------------------------------------\n");
logTextField.setText(sb.toString());
this.setLayout(new BorderLayout());
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
cs = new CoordinateSystem(AxisUnit.OCCURENCES, 0, 1000);
linkedPanel = new LinkedPanel(cs);
linkedPanel.addLayer(new BackgroundLayer(cs));
linkedPanel.addLayer(new ZoomMouseListenerLayer());
linkedPanel.addLayer(new DragMouseListenerLayer(cs));
linkedPanel.addLayer(new BackgroundLayer(cs));
linkedPanel.addLayer(new TimeAxisLayer(cs));
linkedPanel.addLayer(new SelectionLayer(cs));
linkedPanel.getViewPort().addViewPortChangedListener(this);
matches = new ArrayList<NFFTSyncMatch>();
this.streamLayers = new ArrayList<StreamLayer>();
this.streamFiles = new ArrayList<File>();
JTabbedPane tabbedPane = new JTabbedPane();
tabbedPane.addTab("Timebox plot", null, linkedPanel,"Timebox plots");
tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
tabbedPane.addTab("Messages", null, new JScrollPane(logTextField),"Logs messages");
tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
tabbedPane.setTabPlacement(JTabbedPane.BOTTOM);
tabbedPane.setBorder(new EmptyBorder(0,0,0,0));
this.add(tabbedPane,BorderLayout.CENTER);
this.add(createStatusBarPanel(),BorderLayout.SOUTH);
new FileDrop(null, tabbedPane, /*dragBorder,*/ new FileDrop.Listener(){
public void filesDropped( final File[] files ){
new Thread(new Runnable(){
@Override
public void run() {
for( int i = 0; i < files.length; i++) {
final File fileToAdd = files[i];
logMessage("Adding " + fileToAdd.getPath() + "...");
openFile(fileToAdd,streamFiles.size());
logMessage("Added " + fileToAdd.getPath() + ".");
}
}},"File adding thread").start();
}
});
}
示例4: PrintJDialog
import javax.swing.JTabbedPane; //导入方法依赖的package包/类
public PrintJDialog(ControlJFrame objPcontrolJFrame, PrintService[] objPprintServiceA, int intPdefaultServiceIndex) {
// Parse parameters :
super(objPcontrolJFrame, Strings.doConcat(Tools.getLocaleString("dialog.printtitle"), ' ', Strings.strS_ELLIPSIS), true);
this.objGcontrolJFrame = objPcontrolJFrame;
this.objGprintServiceA = objPprintServiceA;
this.intGdefaultServiceIndex = intPdefaultServiceIndex;
this.objGprintService = objPprintServiceA[intPdefaultServiceIndex];
this.bolGvalidated = true;
this.objGhashPrintRequestAttributeSet = new HashPrintRequestAttributeSet();
// Set icon :
final Image imgL = this.objGcontrolJFrame.getJuggleMasterPro().getImage(Constants.intS_FILE_ICON_PRINT, 0);
this.setIconImage(imgL != null ? imgL : this.objGcontrolJFrame.getJuggleMasterPro().getFrame().imgGjmp);
// Build tabbed panel :
this.setLayout(new BorderLayout());
final JTabbedPane objLjTabbedPane = new JTabbedPane();
objLjTabbedPane.setBorder(new EmptyBorder(5, 5, 5, 5));
this.objGprintGeneralJPanel = new PrintGeneralJPanel(this);
objLjTabbedPane.add(Strings.doConcat(Strings.strS_SPACE, Tools.getLocaleString("tab.general"), Strings.strS_SPACE),
this.objGprintGeneralJPanel);
this.objGprintPageSetupJPanel = new PrintPageSetupJPanel(this, objPcontrolJFrame);
objLjTabbedPane.add(Strings.doConcat(Strings.strS_SPACE, Tools.getLocaleString("tab.pagesetup"), Strings.strS_SPACE),
this.objGprintPageSetupJPanel);
this.objGprintAppearanceJPanel = new PrintAppearanceJPanel(this, objPcontrolJFrame);
objLjTabbedPane.add(Strings.doConcat(Strings.strS_SPACE, Tools.getLocaleString("tab.appearance"), Strings.strS_SPACE),
this.objGprintAppearanceJPanel);
this.add(objLjTabbedPane, BorderLayout.CENTER);
this.updatePanels();
// Add OK and cancel buttons :
final JPanel objLbuttonsJPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
objLbuttonsJPanel.setOpaque(true);
this.objGoKJButton = new ExtendedJButton(this.objGcontrolJFrame, Tools.getLocaleString("button.print"));
this.objGoKJButton.addActionListener(this);
objLbuttonsJPanel.add(this.objGoKJButton);
this.getRootPane().setDefaultButton(this.objGoKJButton);
final ExtendedJButton objLcancelJButton = new ExtendedJButton(this.objGcontrolJFrame, Tools.getLocaleString("button.cancel"));
objLcancelJButton.addActionListener(this);
objLbuttonsJPanel.add(objLcancelJButton);
this.add(objLbuttonsJPanel, BorderLayout.SOUTH);
this.addWindowListener(new JDialogWindowListener(this.objGcontrolJFrame, this, false));
this.setResizable(false);
this.validate();
this.pack();
this.objGcontrolJFrame.setWindowBounds(this, this.objGcontrolJFrame, true);
}