本文整理匯總了Java中javax.swing.JDesktopPane.add方法的典型用法代碼示例。如果您正苦於以下問題:Java JDesktopPane.add方法的具體用法?Java JDesktopPane.add怎麽用?Java JDesktopPane.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JDesktopPane
的用法示例。
在下文中一共展示了JDesktopPane.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: jButton1ActionPerformed
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
String pattern1 = "[A-z\\s]*";
String fname = jTextField6.getText();
String box1 = jTextField1.getText();
String box2 = jTextField2.getText();
String box3 = jTextField3.getText();
String box4 = jTextField4.getText();
String box5 = jTextField5.getText();
Integer box7 = Integer.parseInt(jTextField7.getText());
Integer box8 = Integer.parseInt(jTextField8.getText());
if((fname.matches(pattern1))&&(box1.length()==4)&&(box2.length()==4)&&(box3.length()==4)&&(box4.length()==4)&&(box5.length()==3)&&(box7<12)&&(box8>17)) {
JOptionPane.showMessageDialog(rootPane, "payment detils wrong");
JDesktopPane desktopPane = getDesktopPane();
Customerlogin cl =new Customerlogin(cus.getPass_no());
desktopPane.add(cl);
cl.setVisible(true);
this.dispose();
}
// TODO add your handling code here:
}
示例2: Test6505027
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
public Test6505027(JFrame main) {
Container container = main;
if (INTERNAL) {
JInternalFrame frame = new JInternalFrame();
frame.setBounds(OFFSET, OFFSET, WIDTH, HEIGHT);
frame.setVisible(true);
JDesktopPane desktop = new JDesktopPane();
desktop.add(frame, new Integer(1));
container.add(desktop);
container = frame;
}
if (TERMINATE) {
this.table.putClientProperty(KEY, Boolean.TRUE);
}
TableColumn column = this.table.getColumn(COLUMNS[1]);
column.setCellEditor(new DefaultCellEditor(new JComboBox(ITEMS)));
container.add(BorderLayout.NORTH, new JTextField());
container.add(BorderLayout.CENTER, new JScrollPane(this.table));
}
示例3: createUI
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
private static void createUI(String lookAndFeelString) {
internalFrame = new JInternalFrame("Internal", true, true, true, true);
internalFrame.setDefaultCloseOperation(
WindowConstants.DO_NOTHING_ON_CLOSE);
internalFrame.setSize(200, 200);
JDesktopPane desktopPane = new JDesktopPane();
desktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
desktopPane.add(internalFrame);
mainFrame = new JFrame(lookAndFeelString);
mainFrame.setSize(640, 480);
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setContentPane(desktopPane);
mainFrame.setVisible(true);
internalFrame.setVisible(true);
}
示例4: createUI
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
private static void createUI() {
frame = new JFrame();
frame.setUndecorated(true);
frame.setSize(300, 300);
frame.setLocationRelativeTo(null);
final JDesktopPane pane = new JDesktopPane();
final JPanel panel = new JPanel() {
@Override
protected void paintComponent(Graphics g) {
g.setColor(color);
g.fillRect(0, 0, getWidth(), getHeight());
}
};
jif = new JInternalFrame();
jif.add(panel);
jif.setVisible(true);
jif.setSize(300, 300);
pane.add(jif);
frame.add(pane);
frame.setVisible(true);
}
示例5: createAndShowGUI
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
private static void createAndShowGUI() {
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new BorderLayout());
desktopPane = new JDesktopPane();
desktopPane.setBackground(BACKGROUND_COLOR);
frame.add(desktopPane, BorderLayout.CENTER);
frame.setSize(FRAME_SIZE, FRAME_SIZE);
frame.setVisible(true);
internalFrame = new JInternalFrame("Test");
internalFrame.setSize(FRAME_SIZE / 2, FRAME_SIZE / 2);
desktopPane.add(internalFrame);
internalFrame.setVisible(true);
internalFrame.setResizable(true);
frame.setVisible(true);
}
示例6: addProjectFrame
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
/**
* Add a new frame into the main frame.
*
* @param project project frame to add
*/
void addProjectFrame(final JDesktopPane desktop, final ProjectFrame project) {
if (project instanceof FloatingProjectFrame) {
try {
FloatingProjectFrame floatingProject = (FloatingProjectFrame) project;
logger.debug("N°" + desktop.getAllFrames().length);
desktop.add(floatingProject.getInternalFrame());
floatingProject.getInternalFrame().setVisible(true);
floatingProject.getInternalFrame().setSelected(true);
desktop.setSelectedFrame(floatingProject.getInternalFrame());
} catch (Exception e) {
e.printStackTrace();
logger.error("not allowed to set floatingProject visible and selected");
}
} else {
logger.error("Cannot add a " + project.getClass().getSimpleName()
+ " into a " + this.getClass().getSimpleName());
}
}
示例7: organizeCurrentDesktop
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
public void organizeCurrentDesktop(int ncol) {
JDesktopPane currentDesktop = this.getCurrentDesktop();
if (currentDesktop == null) {
return;
}
ProjectFrame[] projectFrames = this.getDesktopProjectFrames();
currentDesktop.removeAll();
GridLayout layout = new GridLayout(0, ncol);
currentDesktop.setLayout(layout);
for (ProjectFrame project : projectFrames) {
currentDesktop.add(project.getGui());
}
currentDesktop.doLayout();
currentDesktop.setLayout(null); // now set layout to free moves
}
示例8: setup
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
protected void setup() {
// ----- get the arguments/coordinates of gol.acl.agents --------------------------------
agentArgs = this.getArguments();
cRow = (Integer) agentArgs[0];
cCol = (Integer) agentArgs[1];
localEnvModel = (HashMap<String, Integer>) agentArgs[2];
// ---------- start and show GUI ------------------------------------------------
gui = new GameOfLifeGUI(cRow, cCol, this);
gui.bClear.setEnabled(false);
gui.bPause.setEnabled(false);
gui.bStart.setEnabled(false);
gui.setResizable(true);
gui.setMaximizable(true);
JDesktopPane desptop = Application.getProjectFocused().getProjectDesktop();
desptop.add(gui);
desptop.getDesktopManager().maximizeFrame(gui);
doWait(3000);
// --- Start cyclic behaviour for this Manager Agent ----------------------------
this.addBehaviour(new StepBehaviour());
this.addBehaviour(new ReceiveBehaviour());
gui.bClear.setEnabled(true);
gui.bPause.setEnabled(false);
gui.bStart.setEnabled(true);
}
示例9: jButton2ActionPerformed
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
JDesktopPane desktopPane = getDesktopPane();
Customerlogin cr = new Customerlogin(cus.getPass_no());
desktopPane.add(cr);
cr.setVisible(true);
this.dispose();
}
示例10: jButton2ActionPerformed
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
JDesktopPane desktopPane = getDesktopPane();
Login lo =new Login();
desktopPane.add(lo);
lo.setVisible(true);
this.dispose();
// TODO add your handling code here:
}
示例11: jButton1ActionPerformed
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
JDesktopPane desktopPane = getDesktopPane();
ManageAirport mngair =new ManageAirport();
desktopPane.add(mngair);
mngair.setVisible(true);
this.dispose();
}
示例12: prepareControls
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
/**
* Creating two JInternalFrames in JDesktopPanes. Put lightweight component into one frame and heavyweight into another.
*/
@Override
protected void prepareControls() {
JDesktopPane desktopPane = new JDesktopPane();
JFrame frame = new JFrame("Test Window");
frame.setSize(300, 300);
frame.setContentPane(desktopPane);
frame.setVisible(true);
JInternalFrame bottomFrame = new JInternalFrame("bottom frame", false, false, false, false);
bottomFrame.setSize(220, 220);
desktopPane.add(bottomFrame);
bottomFrame.setVisible(true);
super.propagateAWTControls(bottomFrame);
JInternalFrame topFrame = new JInternalFrame("top frame", false, false, false, false);
topFrame.setSize(200, 200);
JButton jbutton = new JButton("LW Button") {{
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
lwClicked = true;
}
});
}};
topFrame.add(jbutton);
desktopPane.add(topFrame);
topFrame.setVisible(true);
lLoc = jbutton.getLocationOnScreen();
lLoc.translate(jbutton.getWidth()/2, jbutton.getWidth()/2); //click at middle of the button
}
示例13: Test6802868
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
public Test6802868(JFrame frame) {
JDesktopPane desktop = new JDesktopPane();
this.frame = frame;
this.frame.add(desktop);
this.internal = new JInternalFrame(getClass().getName(), true, true, true, true);
this.internal.setVisible(true);
desktop.add(this.internal);
}
示例14: jButton1ActionPerformed
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
int row = jTable1.getSelectedRow();
if (row == -1) {
JOptionPane.showMessageDialog(rootPane, "Error: No Flight selected");
return;
}
FlightLeg fl = new FlightLeg((int) jTable1.getValueAt(row, 0));
JDesktopPane desktopPane = getDesktopPane();
ChooseSeat cs =new ChooseSeat(cus.getPass_no(),fl.getLeg_no());
desktopPane.add(cs);
cs.setVisible(true);
this.dispose();
// TODO add your handling code here:
}
示例15: jButton2ActionPerformed
import javax.swing.JDesktopPane; //導入方法依賴的package包/類
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
JDesktopPane desktopPane = getDesktopPane();
Adminlogin ad =new Adminlogin();
desktopPane.add(ad);
ad.setVisible(true);
this.dispose();
// TODO add your handling code here:
}