當前位置: 首頁>>代碼示例>>Java>>正文


Java JDesktopPane.add方法代碼示例

本文整理匯總了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:
}
 
開發者ID:YasasshraSolutions,項目名稱:Java-Air-Reservation,代碼行數:24,代碼來源:Payment.java

示例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));
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:23,代碼來源:Test6505027.java

示例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);

}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:20,代碼來源:NormalBoundsTest.java

示例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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:22,代碼來源:DockIconRepaint.java

示例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);
    }
 
開發者ID:JetBrains,項目名稱:jdk8u_jdk,代碼行數:22,代碼來源:JInternalFrameDraggingTest.java

示例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());
  }
}
 
開發者ID:IGNF,項目名稱:geoxygene,代碼行數:26,代碼來源:FloatingMainFrame.java

示例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
}
 
開發者ID:IGNF,項目名稱:geoxygene,代碼行數:18,代碼來源:FloatingMainFrame.java

示例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);

}
 
開發者ID:EnFlexIT,項目名稱:AgentWorkbench,代碼行數:31,代碼來源:SimulationManagerAgent.java

示例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();
}
 
開發者ID:YasasshraSolutions,項目名稱:Java-Air-Reservation,代碼行數:8,代碼來源:Payment.java

示例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:
    }
 
開發者ID:YasasshraSolutions,項目名稱:Java-Air-Reservation,代碼行數:11,代碼來源:Adminlogin.java

示例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();
    
    
}
 
開發者ID:YasasshraSolutions,項目名稱:Java-Air-Reservation,代碼行數:11,代碼來源:Adminlogin.java

示例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
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:35,代碼來源:JInternalFrameOverlapping.java

示例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);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:12,代碼來源:Test6802868.java

示例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:
    }
 
開發者ID:YasasshraSolutions,項目名稱:Java-Air-Reservation,代碼行數:15,代碼來源:BookTickets.java

示例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:
}
 
開發者ID:YasasshraSolutions,項目名稱:Java-Air-Reservation,代碼行數:9,代碼來源:Managecustomer.java


注:本文中的javax.swing.JDesktopPane.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。