コード例 #1
0
ファイル: UserInfoDialog.java プロジェクト: kookse/bboss-rpc
  public UserInfoDialog(Frame parent) {
    super(parent, "Input", true);
    setLayout(null);

    l.setFont(default_font);
    l.setSize(50, 30);
    l.setLocation(30, 50);

    name.setFont(default_font);
    name.setSize(150, 30);
    name.setLocation(90, 50);
    // name.selectAll();

    ok.setFont(default_font);
    ok.setSize(50, 30);
    ok.setLocation(30, 90);

    add(l);
    add(name);
    add(ok);
    ok.addActionListener(this);
    setSize(300, 150);

    Point my_loc = parent.getLocation();
    my_loc.x += 50;
    my_loc.y += 150;
    setLocation(my_loc);
    show();
  }
コード例 #2
0
 public Button designButton(Button b) {
   Border emptyBorder = BorderFactory.createEmptyBorder();
   b.setFocusable(false);
   b.setFont(new Font("Tahoma", Font.BOLD, 12));
   b.setForeground(Color.WHITE);
   b.setBackground(Color.DARK_GRAY);
   return b;
 }
コード例 #3
0
ファイル: web.java プロジェクト: sbinet-staging/mmc
 Panel2(web main) {
   setLayout(new GridLayout(1, 2));
   main.par = new TextArea();
   main.par.setEditable(false);
   main.par.setBackground(Color.black);
   main.par.setForeground(Color.lightGray);
   add(main.par);
   button = new Button("start");
   button.setBackground(Color.black);
   button.setForeground(Color.blue);
   button.setFont(new Font("Default", Font.PLAIN, 32));
   add(button);
   button.addActionListener(main);
 }
コード例 #4
0
ファイル: Applet01_6.java プロジェクト: proenix/wsfip5java
  public void init() {

    Button button1 = new Button("Button 1");
    Button button2 = new Button("Button 1");
    Button button3 = new Button("Button 1");

    Font myFont = new Font("Courier", Font.ITALIC, 12);
    button1.setFont(myFont);

    button1.setForeground(Color.black);
    button2.setForeground(Color.blue);

    button1.setBackground(Color.red);
    button2.setBackground(Color.green);

    this.add(button1);
    this.add(button2);
    this.add(button3);

    isButton1Visible = button1.isVisible();
    isButton2Visible = button2.isVisible();
  }
コード例 #5
0
ファイル: QueuePanel.java プロジェクト: stuartwdouglas/jacorb
 /* WARNING: THIS METHOD WILL BE REGENERATED. */
 private java.awt.Button getDetailsButton() {
   if (ivjDetailsButton == null) {
     try {
       ivjDetailsButton = new java.awt.Button();
       ivjDetailsButton.setName("DetailsButton");
       ivjDetailsButton.setLocation(33, 170);
       ivjDetailsButton.setBackground(java.awt.SystemColor.control);
       ivjDetailsButton.setSize(23, 23);
       ivjDetailsButton.setFont(new java.awt.Font("dialog", 0, 8));
       ivjDetailsButton.setActionCommand("...");
       ivjDetailsButton.setLabel("...");
       // user code begin {1}
       // user code end
     } catch (java.lang.Throwable ivjExc) {
       // user code begin {2}
       // user code end
       handleException(ivjExc);
     }
   }
   ;
   return ivjDetailsButton;
 }
コード例 #6
0
ファイル: Main.java プロジェクト: T0mmy0lsen/Sudoku-1.1
  // swing gui / constructor
  public Main(final Field f) {
    super("Sudoku Solver");
    URL iconURL = getClass().getResource("icon.png");
    ImageIcon img = new ImageIcon(iconURL);
    jFrame.setIconImage(img.getImage());
    Color darkBlue = new Color(51, 102, 153);
    Color lightBlue = new Color(18, 61, 104);

    grid = new JTextField[9][9];
    jGrid.setLayout(new GridLayout(9, 9));
    jGrid.setBorder(BorderFactory.createMatteBorder(5, 5, 5, 5, darkBlue));
    jGrid.setBackground(darkBlue);
    for (int i = 0; i < 9; i++) {
      for (int j = 0; j < 9; j++) {
        grid[i][j] = new JTextField();
        grid[i][j].setDocument(new JTextFieldLimit(1));
        grid[i][j].setFont(new Font("Arial", Font.PLAIN, 20));
        grid[i][j].setHorizontalAlignment(JTextField.CENTER);
        grid[i][j].setText("");
        grid[i][j].setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, lightBlue));
        if (j == 2 || j == 5) {
          grid[i][j].setBorder(BorderFactory.createMatteBorder(1, 1, 1, 5, lightBlue));
        }
        if (i == 2 || i == 5) {
          grid[i][j].setBorder(BorderFactory.createMatteBorder(1, 1, 5, 1, lightBlue));
        }
        if (i == 2 && j == 2) {
          grid[i][j].setBorder(BorderFactory.createMatteBorder(1, 1, 5, 5, lightBlue));
        }
        if (i == 5 && j == 2) {
          grid[i][j].setBorder(BorderFactory.createMatteBorder(1, 1, 5, 5, lightBlue));
        }
        if (i == 2 && j == 5) {
          grid[i][j].setBorder(BorderFactory.createMatteBorder(1, 1, 5, 5, lightBlue));
        }
        if (i == 5 && j == 5) {
          grid[i][j].setBorder(BorderFactory.createMatteBorder(1, 1, 5, 5, lightBlue));
        }
        jGrid.add(grid[i][j]);
      }
    }

    jButton.setLayout(new FlowLayout());
    jButton.setBackground(darkBlue);
    jButton.setPreferredSize(new Dimension(420, 45));

    jButton.add(solve);
    solve.setLabel("Solve");
    solve.setVisible(true);
    solve.setFont(new Font("HelveticaNeue", Font.PLAIN, 20));
    solve.setForeground(Color.BLACK);

    jButton.add(upload);
    upload.setLabel("Upload");
    upload.setVisible(true);
    upload.setFont(new Font("Arial", Font.PLAIN, 20));
    upload.setForeground(Color.BLACK);

    jButton.add(clear);
    clear.setLabel("Clear");
    clear.setVisible(true);
    clear.setFont(new Font("Arial", Font.PLAIN, 20));
    clear.setForeground(Color.BLACK);

    jGrid.setPreferredSize(new Dimension(400, 400));

    jFrame.setResizable(false);
    jFrame.setVisible(true);
    jFrame.setLocationRelativeTo(null);
    jFrame.setSize(420, 480);
    jFrame.setBackground(darkBlue);

    jFrame.add(jGrid, BorderLayout.PAGE_START);
    jFrame.add(jButton, BorderLayout.PAGE_END);

    ActionListener solvedClicked =
        new ActionListener() {
          public void actionPerformed(ActionEvent actionEvent) {
            makeGridWhite();
            gridToModel(f);
            if (!errorFound(f)) {
              runSolve(f);
              makeGrid(f, false);
              solve.setEnabled(false);
            }
          }
        };

    ActionListener uploadClicked =
        new ActionListener() {
          public void actionPerformed(ActionEvent actionEvent) {
            makeGridWhite();
            f.clearModel();
            makeGrid(f, true);
            solve.setEnabled(true);
            f.fromFile();
            makeGrid(f, true);
          }
        };

    ActionListener clearClicked =
        new ActionListener() {
          public void actionPerformed(ActionEvent actionEvent) {
            makeGridWhite();
            f.clearModel();
            makeGrid(f, true);
            solve.setEnabled(true);
          }
        };

    solve.addActionListener(solvedClicked);
    upload.addActionListener(uploadClicked);
    clear.addActionListener(clearClicked);
  }
コード例 #7
0
ファイル: mupdate.java プロジェクト: ayushisrvstv/POS
  mupdate() {
    f = new JFrame("POS");
    p = new Panel();
    l1 = new Label("Welcome:Admin");
    l2 = new Label("POINT   OF   SALE");
    l14 = new Label("Enter Manager_Id");

    l3 = new Label("Name");
    l4 = new Label("Father's_Name");
    l5 = new Label("Manager_Id");
    l6 = new Label("Password");
    l7 = new Label("Gender");
    l9 = new Label("Address");
    l8 = new Label("D.O.B.");
    l10 = new Label("Contact_No.");
    l11 = new Label("E-Mail_Id");
    l12 = new Label("Location");
    l13 =
        new Label(
            "_______________________________________________________________________________________________");

    l15 =
        new Label(
            "_______________________________________________________________________________________________________________________");
    cbg = new CheckboxGroup();
    c1 = new Checkbox("Male", cbg, false);
    c2 = new Checkbox("Female", cbg, false);

    t11 = new TextField();
    t2 = new TextField();
    t3 = new TextField();
    t4 = new TextField();
    t5 = new TextField();
    t6 = new TextField();
    t7 = new TextField();
    t8 = new TextField();
    t9 = new TextField();
    t10 = new TextField();

    try {
      t1 = new Choice();
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      Connection con = DriverManager.getConnection("jdbc:odbc:raman1");
      Statement stm = con.createStatement();
      ResultSet rs = stm.executeQuery("select * from mprofile");
      while (rs.next()) {
        String a2 = rs.getString(3);
        t1.add(a2);
      }
    } catch (Exception e) {
      System.out.println(e);
    }

    b1 = new Button("Search");
    b2 = new Button("Update");
    b3 = new Button("Calendar");
    b4 = new Button("Close");
    b5 = new Button("Back");
    b6 = new Button("Logout");

    f1 = new Font("sherif", Font.BOLD | Font.ITALIC, 45);
    f2 = new Font("sherif", Font.BOLD | Font.ITALIC, 30);
    f3 = new Font("sherif", Font.BOLD | Font.ITALIC, 35);
    f4 = new Font("sherif", Font.BOLD, 20);
    f5 = new Font("sherif", Font.BOLD | Font.ITALIC, 15);
    f6 = new Font("sherif", Font.BOLD | Font.ITALIC, 20);
    l1.setFont(f5);
    l2.setFont(f1);
    l3.setFont(f6);
    l4.setFont(f6);
    l5.setFont(f6);
    l6.setFont(f6);
    l7.setFont(f6);
    l8.setFont(f6);
    l9.setFont(f6);
    l10.setFont(f6);
    l11.setFont(f6);
    l12.setFont(f6);
    l13.setFont(f6);
    l14.setFont(f6);

    b1.setFont(f6);
    b2.setFont(f6);
    b3.setFont(f6);
    b4.setFont(f6);
    b5.setFont(f6);
    b6.setFont(f6);
  }
コード例 #8
0
  public babylonTextDialog(
      Frame parent,
      String myLabel,
      String contents,
      int columns,
      int rows,
      int scrollbars,
      boolean IsModal,
      String dismissString) {
    super(parent, myLabel, IsModal);

    parentFrame = parent;

    myLayout = new GridBagLayout();
    setLayout(myLayout);

    p = new Panel();
    p.setLayout(myLayout);

    textArea = new TextArea(contents, rows, columns, scrollbars);
    textArea.addKeyListener(this);
    textArea.setEditable(false);
    textArea.setFont(babylonPanel.smallFont);
    p.add(
        textArea,
        new babylonConstraints(
            0,
            0,
            1,
            1,
            1.0,
            1.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 5, 0),
            0,
            0));

    dismissButton = new Button(dismissString);
    dismissButton.setFont(babylonPanel.smallFont);
    dismissButton.addActionListener(this);
    dismissButton.addKeyListener(this);
    p.add(
        dismissButton,
        new babylonConstraints(
            0,
            1,
            1,
            1,
            1.0,
            1.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 0),
            0,
            0));

    add(
        p,
        new babylonConstraints(
            0,
            0,
            1,
            1,
            1.0,
            1.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.BOTH,
            new Insets(5, 5, 5, 5),
            0,
            0));

    pack();

    if ((parentFrame instanceof babylonWindow) || (parentFrame instanceof babylonServerWindow))
      babylonPanel.centerDialog(parentFrame, this);
    else babylonPanel.centerDialogOnScreen(this);

    addKeyListener(this);
    addWindowListener(this);
    setResizable(false);
    setVisible(true);
    dismissButton.requestFocus();
  }
コード例 #9
0
  public void execute_TestCase2() throws Exception {
    setUndecorated(true);
    setRootPaneCheckingEnabled(false);
    setForeground(Color.BLACK);
    setBackground(Color.WHITE);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setBounds(100, 100, 774, 353);
    setLocationRelativeTo(null);
    setVisible(true);

    contentPane = new JPanel();
    contentPane.setFocusCycleRoot(true);
    contentPane.setDebugGraphicsOptions(DebugGraphics.NONE_OPTION);
    contentPane.setBounds(new Rectangle(100, 100, 130, 100));
    contentPane.setBackground(Color.WHITE);
    setContentPane(contentPane);
    contentPane.setLayout(null);

    JLabel lblEnterThePath = new JLabel("Select Path of Working Folder");
    lblEnterThePath.setForeground(new Color(128, 128, 128));
    lblEnterThePath.setFont(new Font("Tahoma", Font.BOLD, 11));
    lblEnterThePath.setBackground(new Color(0, 0, 0));
    lblEnterThePath.setBounds(63, 104, 187, 31);
    contentPane.add(lblEnterThePath);

    txtHello = new JTextField();
    txtHello.setName("");
    txtHello.setBounds(271, 104, 296, 31);
    txtHello.setEditable(false);
    contentPane.add(txtHello);
    txtHello.setColumns(10);

    JLabel lblSelectPathOf = new JLabel("Select Path of Configuration File");
    lblSelectPathOf.setForeground(new Color(128, 128, 128));
    lblSelectPathOf.setFont(new Font("Tahoma", Font.BOLD, 11));
    lblSelectPathOf.setBounds(63, 149, 187, 28);
    contentPane.add(lblSelectPathOf);

    textField_1 = new JTextField();
    textField_1.setBounds(271, 146, 296, 31);
    textField_1.setEditable(false);
    contentPane.add(textField_1);
    textField_1.setColumns(10);

    JLabel lblWelcomeToVitalhealth = new JLabel("Welcome to VitalHealth Test Automation Framework");
    lblWelcomeToVitalhealth.setHorizontalTextPosition(SwingConstants.CENTER);
    lblWelcomeToVitalhealth.setForeground(new Color(128, 128, 128));
    lblWelcomeToVitalhealth.setFont(new Font("Tahoma", Font.BOLD, 14));
    lblWelcomeToVitalhealth.setHorizontalAlignment(SwingConstants.CENTER);
    lblWelcomeToVitalhealth.setBackground(Color.BLACK);
    lblWelcomeToVitalhealth.setBounds(191, 22, 465, 34);
    contentPane.add(lblWelcomeToVitalhealth);

    Button button = new Button("Browse");
    button.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
            showOpenFileDialog();
          }
        });
    button.setForeground(Color.WHITE);
    button.setFont(new Font("Dialog", Font.BOLD, 12));
    button.setBackground(new Color(51, 153, 255));
    button.setBounds(573, 104, 113, 31);
    contentPane.add(button);

    Button button_1 = new Button("Browse");
    button_1.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            showOpenFileDialog1();
          }
        });
    button_1.setForeground(Color.WHITE);
    button_1.setFont(new Font("Dialog", Font.BOLD, 12));
    button_1.setBackground(new Color(51, 153, 255));
    button_1.setBounds(573, 146, 113, 31);
    contentPane.add(button_1);

    Button button_2 = new Button("RUN TEST");
    button_2.setForeground(Color.WHITE);
    button_2.setFont(new Font("Dialog", Font.BOLD, 12));
    button_2.setBackground(new Color(30, 144, 255));
    button_2.setBounds(63, 205, 623, 34);
    contentPane.add(button_2);

    Button button_3 = new Button("DOWNLOAD SAMPLE EXCEL WEB");
    button_3.setActionCommand("DOWNLOAD SAMPLE EXCEL WEB");
    button_3.setForeground(new Color(128, 128, 128));
    button_3.setFont(new Font("Dialog", Font.BOLD, 12));
    button_3.setBackground(Color.WHITE);
    button_3.setBounds(564, 309, 200, 34);
    contentPane.add(button_3);

    Button button_4 = new Button("DOWNLOAD SAMPLE EXCEL MOBILE");
    button_4.setForeground(new Color(128, 128, 128));
    button_4.setFont(new Font("Dialog", Font.BOLD, 12));
    button_4.setBackground(Color.WHITE);
    button_4.setActionCommand("DOWNLOAD SAMPLE EXCEL MOBILE");
    button_4.setBounds(23, 309, 227, 34);
    contentPane.add(button_4);

    JLabel icon = new JLabel("");
    Image img = new ImageIcon(this.getClass().getResource("/VitalHealth.png")).getImage();
    icon.setIcon(new ImageIcon(img));
    icon.setBounds(23, 11, 173, 71);
    contentPane.add(icon);

    // L1 l1 = new L1();
    L2 l2 = new L2();
    button_4.addActionListener(new L1(Constants.Download_ExcelWeb, Constants.Excel_NameMobile));
    button_3.addActionListener(new L1(Constants.Download_ExcelWeb, Constants.Excel_NameWeb));
    button_2.addActionListener(l2);
  }