Пример #1
1
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    Banner = new javax.swing.JPanel();
    jToolBar1 = new javax.swing.JToolBar();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jButton4 = new javax.swing.JButton();
    jButton1 = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    userid_txt = new javax.swing.JLabel();
    time_txt = new javax.swing.JLabel();
    date_text = new javax.swing.JLabel();
    display = new javax.swing.JPanel();
    admiinAccount1 = new admiinAccount();
    adminProduct1 = new AdminProduct();
    adminMemberInfo1 = new AdminMemberInfo();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    jToolBar1.setBorder(null);
    jToolBar1.setRollover(true);

    jButton2.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/account.png"))); // NOI18N
    jButton2.setText("Account");
    jButton2.setFocusable(false);
    jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            accountActionPerformed(evt);
          }
        });
    jToolBar1.add(jButton2);

    jButton3.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/product.png"))); // NOI18N
    jButton3.setText("Product");
    jButton3.setFocusable(false);
    jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton3.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            ProductActionPerformed(evt);
          }
        });
    jToolBar1.add(jButton3);

    jButton4.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/mamber.png"))); // NOI18N
    jButton4.setText("Members");
    jButton4.setFocusable(false);
    jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton4.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            MemberActionPerformed(evt);
          }
        });
    jToolBar1.add(jButton4);

    jButton1.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/Sign-Shutdown-icon.png"))); // NOI18N
    jButton1.setText("Sign Out");
    jButton1.setFocusable(false);
    jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            signOutActionPerformed(evt);
          }
        });
    jToolBar1.add(jButton1);

    jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 0, 30));
    jLabel1.setForeground(new java.awt.Color(0, 102, 255));
    jLabel1.setText("MCU Online Shoping");

    userid_txt.setFont(new java.awt.Font("Miriam Fixed", 0, 18));
    userid_txt.setForeground(new java.awt.Color(0, 204, 102));
    userid_txt.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    userid_txt.setText("Welcome, Username");

    time_txt.setFont(new java.awt.Font("Tahoma", 0, 14));
    time_txt.setText("hh:mm:ss");

    date_text.setFont(new java.awt.Font("Tahoma", 0, 14));
    date_text.setText("dd/mm/yyy");

    javax.swing.GroupLayout BannerLayout = new javax.swing.GroupLayout(Banner);
    Banner.setLayout(BannerLayout);
    BannerLayout.setHorizontalGroup(
        BannerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                BannerLayout.createSequentialGroup()
                    .addComponent(
                        jToolBar1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(140, 140, 140)
                    .addComponent(
                        jLabel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        242,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(
                        BannerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                BannerLayout.createSequentialGroup()
                                    .addGap(118, 118, 118)
                                    .addComponent(
                                        time_txt,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        74,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        date_text,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        84,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(
                                BannerLayout.createSequentialGroup()
                                    .addGap(29, 29, 29)
                                    .addComponent(
                                        userid_txt,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        323,
                                        Short.MAX_VALUE)))
                    .addContainerGap()));
    BannerLayout.setVerticalGroup(
        BannerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                BannerLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        BannerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                BannerLayout.createSequentialGroup()
                                    .addComponent(
                                        userid_txt,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        23,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addGroup(
                                        BannerLayout.createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(
                                                time_txt,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                18,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                date_text,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                18,
                                                Short.MAX_VALUE)))
                            .addComponent(
                                jToolBar1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                59,
                                Short.MAX_VALUE)
                            .addComponent(
                                jLabel1,
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                59,
                                Short.MAX_VALUE))
                    .addContainerGap()));

    display.setLayout(new java.awt.CardLayout());
    display.add(admiinAccount1, "account");
    display.add(adminProduct1, "product");
    display.add(adminMemberInfo1, "member");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(
                        Banner,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(18, Short.MAX_VALUE))
            .addGroup(
                layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(
                        display, javax.swing.GroupLayout.DEFAULT_SIZE, 1083, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(
                        Banner,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(542, Short.MAX_VALUE))
            .addGroup(
                layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(
                        layout
                            .createSequentialGroup()
                            .addGap(84, 84, 84)
                            .addComponent(
                                display,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                539,
                                Short.MAX_VALUE))));

    java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    setBounds((screenSize.width - 962) / 2, (screenSize.height - 654) / 2, 962, 654);
  } // </editor-fold>//GEN-END:initComponents
Пример #2
0
 protected void selected(CharPos start, CharPos end) {
   StringBuilder buf = new StringBuilder();
   synchronized (msgs) {
     boolean sel = false;
     for (Message msg : msgs) {
       if (!(msg.text() instanceof RichText)) continue;
       RichText rt = (RichText) msg.text();
       RichText.Part part = null;
       if (sel) {
         part = rt.parts;
       } else if (msg == start.msg) {
         sel = true;
         for (part = rt.parts; part != null; part = part.next) {
           if (part == start.part) break;
         }
       }
       if (sel) {
         for (; part != null; part = part.next) {
           if (!(part instanceof RichText.TextPart)) continue;
           RichText.TextPart tp = (RichText.TextPart) part;
           CharacterIterator iter = tp.ti();
           int sch;
           if (tp == start.part) sch = tp.start + start.ch.getInsertionIndex();
           else sch = tp.start;
           int ech;
           if (tp == end.part) ech = tp.start + end.ch.getInsertionIndex();
           else ech = tp.end;
           for (int i = sch; i < ech; i++) buf.append(iter.setIndex(i));
           if (part == end.part) {
             sel = false;
             break;
           }
           buf.append(' ');
         }
         if (sel) buf.append('\n');
       }
       if (msg == end.msg) break;
     }
   }
   Clipboard cl;
   if ((cl = java.awt.Toolkit.getDefaultToolkit().getSystemSelection()) == null)
     cl = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard();
   try {
     final CharPos ownsel = selstart;
     cl.setContents(
         new StringSelection(buf.toString()),
         new ClipboardOwner() {
           public void lostOwnership(Clipboard cl, Transferable tr) {
             if (selstart == ownsel) selstart = selend = null;
           }
         });
   } catch (IllegalStateException e) {
   }
 }
Пример #3
0
 public void show() {
   java.awt.Dimension dialogSize = this.getPreferredSize();
   java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
   this.setLocation(
       screenSize.width / 2 - dialogSize.width / 2, screenSize.height / 2 - dialogSize.height / 2);
   super.show();
 }
Пример #4
0
 public static java.awt.Image loadImageFromFile(String path) {
   java.io.File file = new java.io.File(path);
   if (file.exists()) {
     java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
     java.awt.Image img = tk.createImage(path);
     try {
       java.awt.MediaTracker mt = new java.awt.MediaTracker(new javax.swing.JPanel());
       mt.addImage(img, 0);
       mt.waitForID(0);
     } catch (Exception ex) {
       return null;
     }
     return img;
   }
   return null;
 }
  private void jMenuItemCutActionPerformed(
      java.awt.event.ActionEvent evt) // GEN-FIRST:event_jMenuItemCutActionPerformed
      { // GEN-HEADEREND:event_jMenuItemCutActionPerformed
    Toolkit t = java.awt.Toolkit.getDefaultToolkit();
    Clipboard c = t.getSystemClipboard();

    JInternalFrame currentFrame = theDesktop.getSelectedFrame();
    /*StringSelection contents = new StringSelection(srcData);
    clipboard.setContents(contents, this);*/

  } // GEN-LAST:event_jMenuItemCutActionPerformed
    protected void bypassFilterAndSetText(StyledDocument doc, String text) {
      try {
        filter.setUpdateValue(false);
        doc.remove(0, doc.getLength());
        doc.insertString(0, text, null);

      } catch (BadLocationException e) {
        java.awt.Toolkit.getDefaultToolkit().beep();
      } finally {
        filter.setUpdateValue(true);
      }
    }
  /** Center a component in the middle of the screen. */
  public static void centerComponent(java.awt.Component component) {
    java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    java.awt.Dimension size = component.getSize();

    screenSize.height = screenSize.height / 2;
    screenSize.width = screenSize.width / 2;

    size.height = size.height / 2;
    size.width = size.width / 2;

    component.setLocation(screenSize.width - size.width, screenSize.height - size.height);
  }
Пример #8
0
  public void redoAction() {
    try {
      if (undoMgr.canRedo()) {
        redoAction.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "Redo"));

        setRedoItem();
      } else {
        java.awt.Toolkit.getDefaultToolkit().beep();
      }
    } catch (CannotUndoException ex) {
      ex.printStackTrace();
    }
  }
Пример #9
0
  public void maxVncViewPanel(VncViewPanel panel) throws Exception {
    log.info("maxVncViewPanel");
    MaxVncPanelWindow component = ViewManager.getComponent(MaxVncPanelWindow.class);
    component.setAlwaysOnTop(true);

    Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    component.setSize(screenSize);
    component.setLocation(0, 0);
    component.getCenterPanel().removeAll();
    Dimension topPanelSize = panel.getTopPanel().getSize();
    panel
        .getDesktopScrollPane()
        .setSize(screenSize.width + 1, screenSize.height - topPanelSize.height - 4);

    component.getCenterPanel().add(panel, BorderLayout.CENTER);
    component.setVncViewPanel(panel);
    component.setVisible(true);
    panel.getDesktopScrollPane().getComponent(0).repaint();

    panel.getMaxViewButton().setVisible(false);
    panel.getRevertViewButton().setVisible(true);
  }
Пример #10
0
  // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
  private void initComponents() {
    jPanel1 = new javax.swing.JPanel();
    jScrollPane3 = new javax.swing.JScrollPane();
    tblRoomsInOrder = new javax.swing.JTable();
    jButton1 = new javax.swing.JButton();
    NgayTratruoc = new com.toedter.calendar.JDateChooser();
    TratruocThoiHan = new javax.swing.JRadioButton();
    jButton5 = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    tblCusInRoom = new javax.swing.JTable();
    jPanel3 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    tblServicesInRoom = new javax.swing.JTable();
    jPanel4 = new javax.swing.JPanel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    sumCostOfSVInOrder = new javax.swing.JTextField();
    sumCostOfRoomInOrder = new javax.swing.JTextField();
    txtAddition = new javax.swing.JTextField();
    jLabel8 = new javax.swing.JLabel();
    txtDiscount = new javax.swing.JTextField();
    txtPay = new javax.swing.JTextField();
    jLabel10 = new javax.swing.JLabel();
    txtTotalSum = new javax.swing.JTextField();
    jLabel11 = new javax.swing.JLabel();
    jButton3 = new javax.swing.JButton();
    txtAdd12 = new javax.swing.JTextField();
    jLabel9 = new javax.swing.JLabel();
    jPanel5 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    txtOrderId = new javax.swing.JTextField();
    jLabel2 = new javax.swing.JLabel();
    txtOrderOfCus = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();
    txtOrderDate = new javax.swing.JTextField();
    jLabel4 = new javax.swing.JLabel();
    txtCurrentDate = new javax.swing.JTextField();
    jPanel6 = new javax.swing.JPanel();
    jButton2 = new javax.swing.JButton();
    jButton4 = new javax.swing.JButton();
    jButton6 = new javax.swing.JButton();
    jPanel7 = new javax.swing.JPanel();
    jScrollPane4 = new javax.swing.JScrollPane();
    tblServicesInOrderOnly = new javax.swing.JTable();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Thanh to\u00e1n \u0111\u01a1n h\u00e0ng");
    setAlwaysOnTop(true);
    jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Danh s\u00e1ch ph\u00f2ng"));
    tblRoomsInOrder.setModel(
        new javax.swing.table.DefaultTableModel(new Object[][] {}, new String[] {}));

    tblRoomsInOrder.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(java.awt.event.MouseEvent evt) {
            tblRoomsInOrderMouseClicked(evt);
          }
        });

    jScrollPane3.setViewportView(tblRoomsInOrder);

    jButton1.setText("Tr\u1ea3 ph\u00f2ng");
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
          }
        });

    TratruocThoiHan.setText("Tr\u1ea3 tr\u01b0\u1edbc th\u1eddi h\u1ea1n");
    TratruocThoiHan.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    TratruocThoiHan.setMargin(new java.awt.Insets(0, 0, 0, 0));
    TratruocThoiHan.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(java.awt.event.MouseEvent evt) {
            TratruocThoiHanMouseClicked(evt);
          }
        });

    jButton5.setText("H\u1ee7y");
    jButton5.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton5ActionPerformed(evt);
          }
        });

    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        jPanel1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(TratruocThoiHan)
                            .add(jButton1))
                    .add(32, 32, 32)
                    .add(
                        jPanel1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jButton5)
                            .add(
                                NgayTratruoc,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(79, Short.MAX_VALUE))
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jScrollPane3,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                353,
                Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jPanel1Layout
                    .createSequentialGroup()
                    .add(
                        jScrollPane3,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        130,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 22, Short.MAX_VALUE)
                    .add(
                        jPanel1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jPanel1Layout
                                    .createSequentialGroup()
                                    .add(TratruocThoiHan)
                                    .add(6, 6, 6)
                                    .add(
                                        jPanel1Layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(jButton1)
                                            .add(jButton5)))
                            .add(
                                NgayTratruoc,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))));

    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Kh\u00e1ch \u0111ang \u1edf"));
    tblCusInRoom.setModel(
        new javax.swing.table.DefaultTableModel(new Object[][] {}, new String[] {}));

    jScrollPane1.setViewportView(tblCusInRoom);

    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
        jPanel2Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE));
    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE));

    jPanel3.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            "Danh s\u00e1ch d\u1ecbc v\u1ee5 g\u1ecdi theo ph\u00f2ng"));
    tblServicesInRoom.setModel(
        new javax.swing.table.DefaultTableModel(new Object[][] {}, new String[] {}));

    jScrollPane2.setViewportView(tblServicesInRoom);

    org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE));
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jScrollPane2,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                73,
                Short.MAX_VALUE));

    jPanel4.setBorder(
        javax.swing.BorderFactory.createTitledBorder("Thanh to\u00e1n \u0111\u01a1n h\u00e0ng"));
    jLabel5.setText("T\u1ed5ng ti\u1ec1n DV");

    jLabel6.setText("Gi\u1ea3m gi\u00e1");

    jLabel7.setText("Ph\u1ee5 ph\u00ed");

    sumCostOfSVInOrder.setEditable(false);

    sumCostOfRoomInOrder.setEditable(false);

    jLabel8.setText("Kh\u00e1ch tr\u1ea3");

    txtPay.setText("0");

    jLabel10.setText("T\u1ed5ng ");

    jLabel11.setText("T\u1ed5ng ti\u1ec1n ph\u00f2ng");

    jButton3.setText("T\u00ednh");
    jButton3.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
          }
        });

    txtAdd12.setEditable(false);

    jLabel9.setText("C\u1ed9ng");

    org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
        jPanel4Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jPanel4Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel5)
                            .add(jLabel11)
                            .add(jLabel9)
                            .add(jLabel7))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                            .add(
                                sumCostOfSVInOrder,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                107,
                                Short.MAX_VALUE)
                            .add(
                                txtAdd12,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                107,
                                Short.MAX_VALUE)
                            .add(
                                sumCostOfRoomInOrder,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                107,
                                Short.MAX_VALUE)
                            .add(
                                txtAddition,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                107,
                                Short.MAX_VALUE))
                    .add(4, 4, 4)
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jPanel4Layout
                                    .createSequentialGroup()
                                    .add(
                                        jPanel4Layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(jLabel6)
                                            .add(jLabel8))
                                    .add(10, 10, 10)
                                    .add(
                                        jPanel4Layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING, false)
                                            .add(txtPay)
                                            .add(
                                                txtDiscount,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                58,
                                                Short.MAX_VALUE)))
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, jButton3)
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                jPanel4Layout
                                    .createSequentialGroup()
                                    .add(jLabel10)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        txtTotalSum,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        83,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    jPanel4Layout.setVerticalGroup(
        jPanel4Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel4Layout
                    .createSequentialGroup()
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel5)
                            .add(jLabel6)
                            .add(
                                sumCostOfSVInOrder,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(
                                txtDiscount,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel11)
                            .add(
                                sumCostOfRoomInOrder,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel8)
                            .add(
                                txtPay,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel10)
                            .add(jLabel9)
                            .add(
                                txtAdd12,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                20,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(
                                txtTotalSum,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jButton3)
                            .add(
                                txtAddition,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel7))
                    .addContainerGap(
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jPanel5.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            javax.swing.BorderFactory.createTitledBorder(
                "Th\u00f4ng tin \u0111\u01a1n h\u00e0ng")));
    jLabel1.setText("M\u00e3 \u0111\u01a1n h\u00e0ng");

    txtOrderId.setEditable(false);

    jLabel2.setText("Ng\u01b0\u1eddi \u0111\u1eb7t ");

    txtOrderOfCus.setEditable(false);

    jLabel3.setText("Ng\u00e0y \u0111\u1eb7t");

    txtOrderDate.setEditable(false);

    jLabel4.setText("H\u00f4m nay");

    org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
        jPanel5Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel5Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        jPanel5Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel1)
                            .add(jLabel2))
                    .add(37, 37, 37)
                    .add(
                        jPanel5Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                txtOrderOfCus,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                231,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(
                                txtOrderId,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                42,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(23, 23, 23)
                    .add(
                        jPanel5Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel4)
                            .add(jLabel3))
                    .addPreferredGap(
                        org.jdesktop.layout.LayoutStyle.RELATED,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .add(
                        jPanel5Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(txtOrderDate)
                            .add(
                                txtCurrentDate,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                177,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    jPanel5Layout.setVerticalGroup(
        jPanel5Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel5Layout
                    .createSequentialGroup()
                    .add(
                        jPanel5Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel1)
                            .add(jLabel3)
                            .add(
                                txtOrderDate,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(
                                txtOrderId,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jPanel5Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel2)
                            .add(
                                jPanel5Layout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(
                                        txtOrderOfCus,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jLabel4)
                                    .add(
                                        txtCurrentDate,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))));

    jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jButton2.setText("H\u1ee7y b\u1ecf");
    jButton2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
          }
        });

    jButton4.setText("Thanh to\u00e1n \u0111\u01a1n h\u00e0ng");
    jButton4.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
          }
        });

    jButton6.setText("In h\u00f3a \u0111\u01a1n");
    jButton6.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(evt);
          }
        });

    org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(
        jPanel6Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jPanel6Layout
                    .createSequentialGroup()
                    .addContainerGap(281, Short.MAX_VALUE)
                    .add(jButton6)
                    .add(15, 15, 15)
                    .add(jButton4)
                    .add(25, 25, 25)
                    .add(jButton2)
                    .addContainerGap()));
    jPanel6Layout.setVerticalGroup(
        jPanel6Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel6Layout
                    .createSequentialGroup()
                    .add(
                        jPanel6Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jButton2)
                            .add(jButton4)
                            .add(jButton6))
                    .addContainerGap(
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jPanel7.setBorder(
        javax.swing.BorderFactory.createTitledBorder("Danh s\u00e1ch d\u1ecbch v\u1ee5 chung"));
    tblServicesInOrderOnly.setModel(
        new javax.swing.table.DefaultTableModel(new Object[][] {}, new String[] {}));

    jScrollPane4.setViewportView(tblServicesInOrderOnly);

    org.jdesktop.layout.GroupLayout jPanel7Layout = new org.jdesktop.layout.GroupLayout(jPanel7);
    jPanel7.setLayout(jPanel7Layout);
    jPanel7Layout.setHorizontalGroup(
        jPanel7Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jScrollPane4,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                257,
                Short.MAX_VALUE));
    jPanel7Layout.setVerticalGroup(
        jPanel7Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jScrollPane4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 96, Short.MAX_VALUE));

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jPanel5,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .add(
                                        jPanel1,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(
                                                jPanel2,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(
                                                jPanel3,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                jPanel6,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .add(
                                        jPanel7,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jPanel4,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .add(
                        jPanel5,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .add(
                                        jPanel2,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jPanel3,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(
                                jPanel1,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jPanel4,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .add(
                                jPanel7,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jPanel6,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));
    pack();
    java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    java.awt.Dimension dialogSize = getSize();
    setLocation(
        (screenSize.width - dialogSize.width) / 2, (screenSize.height - dialogSize.height) / 2);
  } // </editor-fold>//GEN-END:initComponents
Пример #11
0
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jToolBar1 = new javax.swing.JToolBar();
    jPanel1 = new javax.swing.JPanel();
    txtUserID = new javax.swing.JTextField();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    txtUserName = new javax.swing.JTextField();
    lbHour = new javax.swing.JLabel();
    lbDate = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    lbYear = new javax.swing.JLabel();
    jMenuBar1 = new javax.swing.JMenuBar();
    mnMaster = new javax.swing.JMenu();
    mnMasterTitle = new javax.swing.JMenuItem();
    mnMasterEmployee = new javax.swing.JMenuItem();
    mnMasterBudgetGroup = new javax.swing.JMenuItem();
    mnMasterBudgetDetail = new javax.swing.JMenuItem();
    mnTransaction = new javax.swing.JMenu();
    mnTransactionBeginningBalance = new javax.swing.JMenuItem();
    mnTransactionBudgetUsage = new javax.swing.JMenuItem();
    mnTransactionBudgetTransfer = new javax.swing.JMenuItem();
    mnTransactionEndofYear = new javax.swing.JMenuItem();
    mnLaporan = new javax.swing.JMenu();
    mnRptMasterBudget = new javax.swing.JMenuItem();
    mnRptBudgetUsage = new javax.swing.JMenuItem();
    mnRptTrxBudgetUsage = new javax.swing.JMenuItem();
    mnRptTrxBudgetTransfer = new javax.swing.JMenuItem();
    mnUser = new javax.swing.JMenu();
    mnMasterUser = new javax.swing.JMenuItem();
    mnUserFunction = new javax.swing.JMenuItem();
    mnChangePassword = new javax.swing.JMenuItem();
    mnExit = new javax.swing.JMenu();
    mnLogOff = new javax.swing.JMenuItem();
    mnExitExit = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("OPC Budget Controlling Program");
    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent evt) {
            FrmMainMenu.this.windowClosing(evt);
          }
        });

    jToolBar1.setRollover(true);

    jPanel1.setBackground(new java.awt.Color(255, 51, 51));

    txtUserID.setBackground(new java.awt.Color(204, 255, 204));
    txtUserID.setFont(new java.awt.Font("Tahoma", 1, 12));
    txtUserID.setDisabledTextColor(new java.awt.Color(255, 51, 51));
    txtUserID.setEnabled(false);

    jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
    jLabel1.setText("User ID");

    jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12));
    jLabel2.setText("User Name");

    txtUserName.setBackground(new java.awt.Color(204, 255, 204));
    txtUserName.setFont(new java.awt.Font("Tahoma", 1, 12));
    txtUserName.setDisabledTextColor(new java.awt.Color(255, 51, 51));
    txtUserName.setEnabled(false);

    lbHour.setBackground(new java.awt.Color(51, 51, 255));
    lbHour.setFont(new java.awt.Font("Tahoma", 1, 12));
    lbHour.setForeground(new java.awt.Color(51, 255, 51));

    lbDate.setBackground(new java.awt.Color(51, 51, 255));
    lbDate.setFont(new java.awt.Font("Tahoma", 1, 12));
    lbDate.setForeground(new java.awt.Color(51, 255, 51));

    jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12));
    jLabel3.setText("Budget Year");

    lbYear.setBackground(new java.awt.Color(51, 51, 255));
    lbYear.setFont(new java.awt.Font("Tahoma", 1, 12));
    lbYear.setForeground(new java.awt.Color(51, 255, 51));

    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(jLabel1)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        txtUserID,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        123,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(18, 18, 18)
                    .add(
                        jLabel2,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        txtUserName,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        133,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(26, 26, 26)
                    .add(
                        lbDate,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        123,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(
                        lbHour,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        85,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(75, 75, 75)
                    .add(
                        jLabel3,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(
                        lbYear,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        62,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(50, 50, 50)));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel1Layout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(
                        txtUserID,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel1)
                    .add(
                        txtUserName,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel2)
                    .add(
                        lbDate,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        20,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(
                        lbHour,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        20,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(
                        lbYear,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        20,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel3)));

    jToolBar1.add(jPanel1);

    mnMaster.setBackground(new java.awt.Color(204, 255, 255));
    mnMaster.setText("Master");
    mnMaster.setFont(new java.awt.Font("Tahoma", 1, 12));

    mnMasterTitle.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK));
    mnMasterTitle.setBackground(new java.awt.Color(255, 255, 204));
    mnMasterTitle.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnMasterTitle.setText("Title");
    mnMasterTitle.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnMasterTitleActionPerformed(evt);
          }
        });
    mnMaster.add(mnMasterTitle);

    mnMasterEmployee.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_Y, java.awt.event.InputEvent.CTRL_MASK));
    mnMasterEmployee.setBackground(new java.awt.Color(255, 255, 204));
    mnMasterEmployee.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnMasterEmployee.setText("Employee");
    mnMasterEmployee.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnMasterEmployeeActionPerformed(evt);
          }
        });
    mnMaster.add(mnMasterEmployee);

    mnMasterBudgetGroup.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.CTRL_MASK));
    mnMasterBudgetGroup.setBackground(new java.awt.Color(255, 255, 204));
    mnMasterBudgetGroup.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnMasterBudgetGroup.setText("Budget Group");
    mnMasterBudgetGroup.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnMasterBudgetGroupActionPerformed(evt);
          }
        });
    mnMaster.add(mnMasterBudgetGroup);

    mnMasterBudgetDetail.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.CTRL_MASK));
    mnMasterBudgetDetail.setBackground(new java.awt.Color(255, 255, 204));
    mnMasterBudgetDetail.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnMasterBudgetDetail.setText("Budget Detail");
    mnMasterBudgetDetail.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnMasterBudgetDetailActionPerformed(evt);
          }
        });
    mnMaster.add(mnMasterBudgetDetail);

    jMenuBar1.add(mnMaster);

    mnTransaction.setBackground(new java.awt.Color(204, 255, 255));
    mnTransaction.setText("Transaction");
    mnTransaction.setFont(new java.awt.Font("Tahoma", 1, 12));

    mnTransactionBeginningBalance.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
    mnTransactionBeginningBalance.setBackground(new java.awt.Color(255, 255, 204));
    mnTransactionBeginningBalance.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnTransactionBeginningBalance.setText("Beginning Balance");
    mnTransactionBeginningBalance.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnTransactionBeginningBalanceActionPerformed(evt);
          }
        });
    mnTransaction.add(mnTransactionBeginningBalance);

    mnTransactionBudgetUsage.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
    mnTransactionBudgetUsage.setBackground(new java.awt.Color(255, 255, 204));
    mnTransactionBudgetUsage.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnTransactionBudgetUsage.setText("Budget Usage");
    mnTransactionBudgetUsage.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnTransactionBudgetUsageActionPerformed(evt);
          }
        });
    mnTransaction.add(mnTransactionBudgetUsage);

    mnTransactionBudgetTransfer.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));
    mnTransactionBudgetTransfer.setBackground(new java.awt.Color(255, 255, 204));
    mnTransactionBudgetTransfer.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnTransactionBudgetTransfer.setText("Budget Transfer");
    mnTransactionBudgetTransfer.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnTransactionBudgetTransferActionPerformed(evt);
          }
        });
    mnTransaction.add(mnTransactionBudgetTransfer);

    mnTransactionEndofYear.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK));
    mnTransactionEndofYear.setBackground(new java.awt.Color(255, 255, 204));
    mnTransactionEndofYear.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnTransactionEndofYear.setText("End of Year");
    mnTransactionEndofYear.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnTransactionEndofYearActionPerformed(evt);
          }
        });
    mnTransaction.add(mnTransactionEndofYear);

    jMenuBar1.add(mnTransaction);

    mnLaporan.setBackground(new java.awt.Color(204, 255, 255));
    mnLaporan.setText("Report");
    mnLaporan.setFont(new java.awt.Font("Tahoma", 1, 12));

    mnRptMasterBudget.setBackground(new java.awt.Color(255, 255, 204));
    mnRptMasterBudget.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnRptMasterBudget.setText("Master Budget");
    mnRptMasterBudget.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnRptMasterBudgetActionPerformed(evt);
          }
        });
    mnLaporan.add(mnRptMasterBudget);

    mnRptBudgetUsage.setBackground(new java.awt.Color(255, 255, 204));
    mnRptBudgetUsage.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnRptBudgetUsage.setText("Budget Detail Per Month");
    mnRptBudgetUsage.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnRptBudgetUsageActionPerformed(evt);
          }
        });
    mnLaporan.add(mnRptBudgetUsage);

    mnRptTrxBudgetUsage.setBackground(new java.awt.Color(255, 255, 204));
    mnRptTrxBudgetUsage.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnRptTrxBudgetUsage.setText("Trx. Budget Usage");
    mnRptTrxBudgetUsage.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnRptTrxBudgetUsageActionPerformed(evt);
          }
        });
    mnLaporan.add(mnRptTrxBudgetUsage);

    mnRptTrxBudgetTransfer.setBackground(new java.awt.Color(255, 255, 204));
    mnRptTrxBudgetTransfer.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnRptTrxBudgetTransfer.setText("Trx. Budget Transfer");
    mnRptTrxBudgetTransfer.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnRptTrxBudgetTransferActionPerformed(evt);
          }
        });
    mnLaporan.add(mnRptTrxBudgetTransfer);

    jMenuBar1.add(mnLaporan);

    mnUser.setBackground(new java.awt.Color(204, 255, 255));
    mnUser.setText("Users Management");
    mnUser.setFont(new java.awt.Font("Tahoma", 1, 12));

    mnMasterUser.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_F5, java.awt.event.InputEvent.CTRL_MASK));
    mnMasterUser.setBackground(new java.awt.Color(255, 255, 204));
    mnMasterUser.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnMasterUser.setText("User");
    mnMasterUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnMasterUserActionPerformed(evt);
          }
        });
    mnUser.add(mnMasterUser);

    mnUserFunction.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_F6, java.awt.event.InputEvent.CTRL_MASK));
    mnUserFunction.setBackground(new java.awt.Color(255, 255, 204));
    mnUserFunction.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnUserFunction.setText("User Functions");
    mnUserFunction.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnUserFunctionActionPerformed(evt);
          }
        });
    mnUser.add(mnUserFunction);

    mnChangePassword.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_F7, java.awt.event.InputEvent.CTRL_MASK));
    mnChangePassword.setBackground(new java.awt.Color(255, 255, 204));
    mnChangePassword.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnChangePassword.setText("Change Password");
    mnChangePassword.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnChangePasswordActionPerformed(evt);
          }
        });
    mnUser.add(mnChangePassword);

    jMenuBar1.add(mnUser);

    mnExit.setBackground(new java.awt.Color(204, 255, 255));
    mnExit.setText("Exit");
    mnExit.setFont(new java.awt.Font("Tahoma", 1, 12));

    mnLogOff.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
    mnLogOff.setBackground(new java.awt.Color(255, 255, 204));
    mnLogOff.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnLogOff.setText("Log Off");
    mnLogOff.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnLogOffActionPerformed(evt);
          }
        });
    mnExit.add(mnLogOff);

    mnExitExit.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK));
    mnExitExit.setBackground(new java.awt.Color(255, 255, 204));
    mnExitExit.setFont(new java.awt.Font("Tahoma", 1, 12));
    mnExitExit.setText("Exit");
    mnExitExit.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            mnExitExitActionPerformed(evt);
          }
        });
    mnExit.add(mnExitExit);

    jMenuBar1.add(mnExit);

    setJMenuBar(jMenuBar1);

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 925, Short.MAX_VALUE));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .add(
                        jToolBar1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        25,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(649, Short.MAX_VALUE)));

    pack();
    java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    java.awt.Dimension dialogSize = getSize();
    setLocation(
        (screenSize.width - dialogSize.width) / 2, (screenSize.height - dialogSize.height) / 2);
  } // </editor-fold>//GEN-END:initComponents
Пример #12
0
  /** @param arg */
  public static void main(String arg[]) {
    TestApp af = new TestApp();

    SourceImage sImg = null;

    int imagesPerRow = 0;
    int imagesPerCol = 0;

    int imgMin = 65536;
    int imgMax = 0;

    boolean signed = false;
    boolean inverted = false;
    boolean hasPad = false;
    int padValue = 0;

    if (arg.length == 6) {
      // do it with raw file
      int w = 0;
      int h = 0;
      int d = 0;
      try {
        w = Integer.valueOf(arg[1]).intValue();
        h = Integer.valueOf(arg[2]).intValue();
        d = Integer.valueOf(arg[3]).intValue();
        imagesPerRow = Integer.valueOf(arg[4]).intValue();
        imagesPerCol = Integer.valueOf(arg[5]).intValue();
      } catch (Exception e) {
        System.err.println(e);
        System.exit(0);
      }

      try {
        FileInputStream i = new FileInputStream(arg[0]);
        sImg = new SourceImage(i, w, h, d);
      } catch (Exception e) {
        System.err.println(e);
        System.exit(0);
      }
    } else {
      // do it with DICOM file

      if (arg.length > 2) {
        try {
          imagesPerRow = Integer.valueOf(arg[1]).intValue();
          imagesPerCol = Integer.valueOf(arg[2]).intValue();
        } catch (Exception e) {
          System.err.println(e);
          e.printStackTrace(System.err);
          System.exit(0);
        }
      } else {
        imagesPerRow = 1;
        imagesPerCol = 1;
      }

      try {
        DicomInputStream i = new DicomInputStream(new FileInputStream(arg[0]));
        sImg = new SourceImage(i);
      } catch (Exception e) {
        System.err.println(e);
        e.printStackTrace(System.err);
        System.exit(0);
      }
    }

    try {
      // com.apple.cocoa.application.NSMenu.setMenuBarVisible(false);							// Won't compile on
      // other platforms
      // Class classToUse =
      // ClassLoader.getSystemClassLoader().loadClass("com.apple.cocoa.application.NSMenu");	//
      // Needs "/System/Library/Java" in classpath
      Class classToUse =
          new java.net.URLClassLoader(new java.net.URL[] {new File("/System/Library/Java").toURL()})
              .loadClass("com.apple.cocoa.application.NSMenu");
      Class[] parameterTypes = {Boolean.TYPE};
      java.lang.reflect.Method methodToUse =
          classToUse.getDeclaredMethod("setMenuBarVisible", parameterTypes);
      Object[] args = {Boolean.FALSE};
      methodToUse.invoke(null /*since static*/, args);
    } catch (Exception e) { // ClassNotFoundException,NoSuchMethodException,IllegalAccessException
      e.printStackTrace(System.err);
    }

    java.awt.Dimension d = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    int frameWidth = (int) d.getWidth();
    int frameHeight = (int) d.getHeight();
    System.err.println("frameWidth=" + frameWidth);
    System.err.println("frameHeight=" + frameHeight);
    af.setUndecorated(true);
    af.setLocation(0, 0);
    af.setSize(frameWidth, frameHeight);

    JPanel multiPanel = new JPanel();
    multiPanel.setLayout(new GridLayout(imagesPerCol, imagesPerRow));
    multiPanel.setBackground(Color.black);

    SingleImagePanel imagePanel[] = new SingleImagePanel[imagesPerRow * imagesPerCol];

    int singleWidth = frameWidth / imagesPerRow;
    int singleHeight = frameHeight / imagesPerCol;
    System.err.println("singleWidth=" + singleWidth);
    System.err.println("singleHeight=" + singleHeight);

    for (int x = 0; x < imagesPerCol; ++x) {
      for (int y = 0; y < imagesPerRow; ++y) {
        SingleImagePanel ip = new SingleImagePanel(sImg);
        // ip.setPreferredSize(new Dimension(img.getWidth(),img.getHeight()));
        // ip.setPreferredSize(new Dimension(sImg.getWidth(),sImg.getHeight()));
        ip.setPreferredSize(new Dimension(singleWidth, singleHeight));
        multiPanel.add(ip);
        imagePanel[x * imagesPerRow + y] = ip;
      }
    }

    // multiPanel.setSize(img.getWidth()*imagesPerRow,img.getHeight()*imagesPerRow);

    // JScrollPane scrollPane = new JScrollPane(multiPanel);

    Container content = af.getContentPane();
    content.setLayout(new GridLayout(1, 1));
    // content.add(scrollPane);
    content.add(multiPanel);

    af.pack();
    af.setVisible(true);
  }
Пример #13
0
  /**
   * This method is called from within the constructor to initialize the form. WARNING: Do NOT
   * modify this code. The content of this method is always regenerated by the FormEditor.
   */
  private void initComponents() { // GEN-BEGIN:initComponents
    label1 = new java.awt.Label();
    panel1 = new java.awt.Panel();
    label2 = new java.awt.Label();
    textField1 = new java.awt.TextField();
    label3 = new java.awt.Label();
    textField2 = new java.awt.TextField();
    button1 = new java.awt.Button();
    button2 = new java.awt.Button();
    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosing(java.awt.event.WindowEvent evt) {
            exitForm(evt);
          }
        });

    label1.setFont(new java.awt.Font("Dialog", 0, 11));
    label1.setBackground(new java.awt.Color(204, 204, 204));
    label1.setForeground(java.awt.Color.black);
    label1.setText("Rent Apartment Out");
    label1.setAlignment(java.awt.Label.CENTER);

    add(label1, java.awt.BorderLayout.NORTH);

    panel1.setLayout(new java.awt.GridLayout(3, 2));
    panel1.setFont(new java.awt.Font("Dialog", 0, 11));
    panel1.setName("panel23");
    panel1.setBackground(new java.awt.Color(204, 204, 204));
    panel1.setForeground(java.awt.Color.black);

    label2.setFont(new java.awt.Font("Dialog", 0, 11));
    label2.setBackground(new java.awt.Color(204, 204, 204));
    label2.setForeground(java.awt.Color.black);
    label2.setText("Customer #");
    panel1.add(label2);

    textField1.setBackground(java.awt.Color.white);
    textField1.setName("textfield20");
    textField1.setFont(new java.awt.Font("Dialog", 0, 11));
    textField1.setForeground(java.awt.Color.black);
    panel1.add(textField1);

    label3.setFont(new java.awt.Font("Dialog", 0, 11));
    label3.setBackground(new java.awt.Color(204, 204, 204));
    label3.setForeground(java.awt.Color.black);
    label3.setText("Apartment #");
    panel1.add(label3);

    textField2.setBackground(java.awt.Color.white);
    textField2.setName("textfield21");
    textField2.setFont(new java.awt.Font("Dialog", 0, 11));
    textField2.setForeground(java.awt.Color.black);
    panel1.add(textField2);

    button1.setFont(new java.awt.Font("Dialog", 0, 11));
    button1.setLabel("Rent it");
    button1.setName("button31");
    button1.setBackground(java.awt.Color.lightGray);
    button1.setForeground(java.awt.Color.black);
    button1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            button1ActionPerformed(evt);
          }
        });
    panel1.add(button1);

    button2.setFont(new java.awt.Font("Dialog", 0, 11));
    button2.setLabel("Cancel");
    button2.setName("button32");
    button2.setBackground(java.awt.Color.lightGray);
    button2.setForeground(java.awt.Color.black);
    button2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            button2ActionPerformed(evt);
          }
        });
    panel1.add(button2);

    add(panel1, java.awt.BorderLayout.CENTER);
    java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    java.awt.Dimension dialogSize = getSize();
    setSize(new java.awt.Dimension(300, 200));
    setLocation((screenSize.width - 300) / 2, (screenSize.height - 200) / 2);
  } // GEN-END:initComponents
  // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
  private void initComponents() {
    buttonGroup1 = new javax.swing.ButtonGroup();
    buttonGroup2 = new javax.swing.ButtonGroup();
    buttonGroup3 = new javax.swing.ButtonGroup();
    buttonGroup4 = new javax.swing.ButtonGroup();
    buttonGroup5 = new javax.swing.ButtonGroup();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jSpinnerZoomX = new javax.swing.JSpinner();
    jSpinnerZoomY = new javax.swing.JSpinner();
    jLabel3 = new javax.swing.JLabel();
    jSpinnerStepX = new javax.swing.JSpinner();
    jPanel1 = new javax.swing.JPanel();
    jCheckBox1 = new javax.swing.JCheckBox();
    jCheckBox2 = new javax.swing.JCheckBox();
    jPanel2 = new javax.swing.JPanel();
    jCheckBox3 = new javax.swing.JCheckBox();
    jCheckBox4 = new javax.swing.JCheckBox();
    jBtnOK = new javax.swing.JButton();
    jBtnCancel = new javax.swing.JButton();
    jLabel4 = new javax.swing.JLabel();
    jSpinnerStepY = new javax.swing.JSpinner();
    jPanel3 = new javax.swing.JPanel();
    jRadioButton1 = new javax.swing.JRadioButton();
    jRadioButton2 = new javax.swing.JRadioButton();
    jPanel4 = new javax.swing.JPanel();
    jRadioButton3 = new javax.swing.JRadioButton();
    jRadioButton4 = new javax.swing.JRadioButton();
    jPanel5 = new javax.swing.JPanel();
    jRadioButton5 = new javax.swing.JRadioButton();
    jRadioButton6 = new javax.swing.JRadioButton();
    jPanel6 = new javax.swing.JPanel();
    jRadioButton7 = new javax.swing.JRadioButton();
    jRadioButton8 = new javax.swing.JRadioButton();
    jPanel7 = new javax.swing.JPanel();
    jRadioButton9 = new javax.swing.JRadioButton();
    jRadioButton10 = new javax.swing.JRadioButton();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jLabel8 = new javax.swing.JLabel();
    jSpinnerMinX = new javax.swing.JSpinner();
    jSpinnerMaxX = new javax.swing.JSpinner();
    jSpinnerMinY = new javax.swing.JSpinner();
    jSpinnerMaxY = new javax.swing.JSpinner();
    jCheckBoxFadenKreuzVisible = new javax.swing.JCheckBox();

    getContentPane().setLayout(null);

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    String strLocale = Locale.getDefault().toString();

    if (strLocale.equalsIgnoreCase("de_DE")) {
      setTitle("Eigenschaften");
      jLabel1.setText("zoom X");
      jLabel2.setText("zoom Y");
      jLabel3.setText("Font-StepX");
      jPanel1.setBorder(new javax.swing.border.TitledBorder("Schrift einblenden"));
      jCheckBox1.setText("Schrift X-Achse");
      jCheckBox2.setText("Schrift Y-Achse");
      jPanel2.setBorder(new javax.swing.border.TitledBorder("Hilfslinien einblenden"));
      jCheckBox3.setText("X-Achse");
      jCheckBox4.setText("Y-Achse");
      jBtnOK.setText("OK");
      jBtnCancel.setText("Abbrechen");
      jLabel4.setText("Font-StepY");
      jPanel3.setBorder(new javax.swing.border.TitledBorder("Werte einblenden als"));
      buttonGroup5.add(jRadioButton1);
      jRadioButton1.setText("Punkte");
      jRadioButton2.setText("Linie");
      jPanel4.setBorder(new javax.swing.border.TitledBorder("X-Achse anordnung"));
      buttonGroup1.add(jRadioButton3);
      jRadioButton3.setText("mittig");
      jRadioButton4.setText("unten");
      jPanel5.setBorder(new javax.swing.border.TitledBorder("Y-Achse anordnung"));
      buttonGroup2.add(jRadioButton5);
      jRadioButton5.setText("mittig");
      jRadioButton6.setText("links");
      jPanel6.setBorder(new javax.swing.border.TitledBorder("X-Achse Zahnelreihe"));
      buttonGroup3.add(jRadioButton7);
      jRadioButton7.setText("mittig");
      jRadioButton8.setText("unten");
      jPanel7.setBorder(new javax.swing.border.TitledBorder("Y-Achse Zahnelreihe"));
      jRadioButton9.setText("mittig");
      jRadioButton10.setText("links");
      jLabel5.setText("minX");
      jLabel6.setText("maxX");
      jLabel7.setText("minY");
      jLabel8.setText("maxY");
      jCheckBoxFadenKreuzVisible.setText("Fadenkreuz sichtbar");
    }

    if (strLocale.equalsIgnoreCase("en_US")) {
      setTitle("Properties");
      jLabel1.setText("zoom X");
      jLabel2.setText("zoom Y");
      jLabel3.setText("Font-StepX");
      jPanel1.setBorder(new javax.swing.border.TitledBorder("Text visible"));
      jCheckBox1.setText("Font X-Axis");
      jCheckBox2.setText("Font Y-Axis");
      jPanel2.setBorder(new javax.swing.border.TitledBorder("Lines visible"));
      jCheckBox3.setText("X-Axis");
      jCheckBox4.setText("Y-Axis");
      jBtnOK.setText("OK");
      jBtnCancel.setText("Cancel");
      jLabel4.setText("Font-StepY");
      jPanel3.setBorder(new javax.swing.border.TitledBorder("Values as"));
      buttonGroup5.add(jRadioButton1);
      jRadioButton1.setText("Point");
      jRadioButton2.setText("Line");
      jPanel4.setBorder(new javax.swing.border.TitledBorder("X-Axis align"));
      jRadioButton3.setText("center");
      jRadioButton4.setText("bottom");
      jPanel5.setBorder(new javax.swing.border.TitledBorder("Y-Axis align"));
      jRadioButton5.setText("center");
      jRadioButton6.setText("left");
      jPanel6.setBorder(new javax.swing.border.TitledBorder("X-Axis Numbers"));
      jRadioButton7.setText("center");
      jRadioButton8.setText("bottom");
      jPanel7.setBorder(new javax.swing.border.TitledBorder("Y-Axis Numbers"));
      jRadioButton9.setText("center");
      jRadioButton10.setText("left");
      jLabel5.setText("minX");
      jLabel6.setText("maxX");
      jLabel7.setText("minY");
      jLabel8.setText("maxY");
      jCheckBoxFadenKreuzVisible.setText("Cross visible");
    }

    if (strLocale.equalsIgnoreCase("es_ES")) {
      setTitle("Properties");
      jLabel1.setText("zoom X");
      jLabel2.setText("zoom Y");
      jLabel3.setText("Font-StepX");
      jPanel1.setBorder(new javax.swing.border.TitledBorder("Text visible"));
      jCheckBox1.setText("Font X-Axis");
      jCheckBox2.setText("Font Y-Axis");
      jPanel2.setBorder(new javax.swing.border.TitledBorder("Lines visible"));
      jCheckBox3.setText("X-Axis");
      jCheckBox4.setText("Y-Axis");
      jBtnOK.setText("OK");
      jBtnCancel.setText("Cancel");
      jLabel4.setText("Font-StepY");
      jPanel3.setBorder(new javax.swing.border.TitledBorder("Values as"));
      buttonGroup5.add(jRadioButton1);
      jRadioButton1.setText("Point");
      jRadioButton2.setText("Line");
      jPanel4.setBorder(new javax.swing.border.TitledBorder("X-Axis align"));
      jRadioButton3.setText("center");
      jRadioButton4.setText("bottom");
      jPanel5.setBorder(new javax.swing.border.TitledBorder("Y-Axis align"));
      jRadioButton5.setText("center");
      jRadioButton6.setText("left");
      jPanel6.setBorder(new javax.swing.border.TitledBorder("X-Axis Numbers"));
      jRadioButton7.setText("center");
      jRadioButton8.setText("bottom");
      jPanel7.setBorder(new javax.swing.border.TitledBorder("Y-Axis Numbers"));
      jRadioButton9.setText("center");
      jRadioButton10.setText("left");
      jLabel5.setText("minX");
      jLabel6.setText("maxX");
      jLabel7.setText("minY");
      jLabel8.setText("maxY");
      jCheckBoxFadenKreuzVisible.setText("Cross visible");
    }

    getContentPane().add(jLabel1);
    jLabel1.setBounds(10, 110, 60, 14);
    getContentPane().add(jLabel2);
    jLabel2.setBounds(10, 140, 60, 14);
    getContentPane().add(jSpinnerZoomX);
    jSpinnerZoomX.setBounds(70, 110, 80, 20);
    getContentPane().add(jSpinnerZoomY);
    jSpinnerZoomY.setBounds(70, 140, 80, 20);
    getContentPane().add(jLabel3);
    jLabel3.setBounds(170, 110, 80, 14);
    getContentPane().add(jSpinnerStepX);
    jSpinnerStepX.setBounds(240, 110, 80, 20);
    jCheckBox1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCheckBox1ActionPerformed(evt);
          }
        });
    jPanel1.add(jCheckBox1);
    jPanel1.add(jCheckBox2);
    getContentPane().add(jPanel1);
    jPanel1.setBounds(20, 170, 140, 90);
    jPanel2.add(jCheckBox3);
    jPanel2.add(jCheckBox4);
    getContentPane().add(jPanel2);
    jPanel2.setBounds(180, 170, 140, 90);
    jBtnOK.setMnemonic('O');
    jBtnOK.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jBtnOKActionPerformed(evt);
          }
        });
    getContentPane().add(jBtnOK);
    jBtnOK.setBounds(120, 480, 90, 23);
    jBtnCancel.setMnemonic('b');
    jBtnCancel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jBtnCancelActionPerformed(evt);
          }
        });
    getContentPane().add(jBtnCancel);
    jBtnCancel.setBounds(220, 480, 100, 23);
    getContentPane().add(jLabel4);
    jLabel4.setBounds(170, 140, 70, 14);
    getContentPane().add(jSpinnerStepY);
    jSpinnerStepY.setBounds(240, 140, 80, 20);
    jPanel3.add(jRadioButton1);
    buttonGroup5.add(jRadioButton2);
    jPanel3.add(jRadioButton2);
    getContentPane().add(jPanel3);
    jPanel3.setBounds(20, 400, 140, 59);
    jPanel4.add(jRadioButton3);
    buttonGroup1.add(jRadioButton4);
    jPanel4.add(jRadioButton4);
    getContentPane().add(jPanel4);
    jPanel4.setBounds(20, 270, 140, 59);
    jPanel5.add(jRadioButton5);
    buttonGroup2.add(jRadioButton6);
    jPanel5.add(jRadioButton6);
    getContentPane().add(jPanel5);
    jPanel5.setBounds(180, 270, 140, 59);
    jPanel6.add(jRadioButton7);
    buttonGroup3.add(jRadioButton8);
    jPanel6.add(jRadioButton8);
    getContentPane().add(jPanel6);
    jPanel6.setBounds(20, 330, 140, 59);
    buttonGroup4.add(jRadioButton9);
    jPanel7.add(jRadioButton9);
    buttonGroup4.add(jRadioButton10);
    jPanel7.add(jRadioButton10);
    getContentPane().add(jPanel7);
    jPanel7.setBounds(180, 330, 140, 59);
    getContentPane().add(jLabel5);
    jLabel5.setBounds(10, 30, 40, 14);
    getContentPane().add(jLabel6);
    jLabel6.setBounds(10, 60, 40, 14);
    getContentPane().add(jLabel7);
    jLabel7.setBounds(170, 30, 50, 14);
    getContentPane().add(jLabel8);
    jLabel8.setBounds(170, 60, 60, 14);
    getContentPane().add(jSpinnerMinX);
    jSpinnerMinX.setBounds(70, 30, 80, 20);
    getContentPane().add(jSpinnerMaxX);
    jSpinnerMaxX.setBounds(70, 60, 80, 20);
    getContentPane().add(jSpinnerMinY);
    jSpinnerMinY.setBounds(240, 30, 80, 20);
    getContentPane().add(jSpinnerMaxY);
    jSpinnerMaxY.setBounds(240, 60, 80, 20);
    getContentPane().add(jCheckBoxFadenKreuzVisible);
    jCheckBoxFadenKreuzVisible.setBounds(180, 410, 140, 23);

    java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    setBounds((screenSize.width - 343) / 2, (screenSize.height - 538) / 2, 343, 538);
  }
Пример #15
0
 public static void centerFrame(java.awt.Component c) {
   java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
   c.setLocation(
       (int) ((tk.getScreenSize().getWidth() - c.getWidth()) / 2),
       (int) ((tk.getScreenSize().getHeight() - c.getHeight()) / 2));
 }