Java JFrame buildButton(String btnName, JFrame frame, int x, int y, int w, int h)

Here you can find the source of buildButton(String btnName, JFrame frame, int x, int y, int w, int h)

Description

build Button

License

Open Source License

Declaration

private static JButton buildButton(String btnName, JFrame frame, int x, int y, int w, int h) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Color;
import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JFrame;

public class Main {
    private static JButton buildButton(String btnName, JFrame frame, int x, int y, int w, int h) { //placing buttons
        JButton btn = new JButton(btnName);
        btn.setLayout(null);//from   w w  w  .j a va2  s  .  c o m
        btn.setBorderPainted(true);
        frame.add(btn);
        btn.setLocation(x, y);
        btn.setSize(w, h);
        btn.setForeground(Color.RED);
        btn.setOpaque(true);
        btn.setBackground(Color.YELLOW);
        btn.setForeground(Color.black);
        btn.setFont(new Font("Canadra", Font.BOLD, 25));
        return btn;
    }
}

Related

  1. addToQue(JFrame frame)
  2. allPlatformGetFile(String dialogTitle, File locationIn, final String fileExtension, FileFilter nonMacFileFilter, boolean allowMultipleSelect, JFrame parentFrame)
  3. askSave(JFrame frame)
  4. attachAccelerator(Action action, JFrame frame)
  5. btnMnemonicAndToolTip(JFrame frame, JButton a, JButton b, JButton c, JButton e, JButton h, JButton i, JButton l, JButton m, JButton o, JButton p, JButton s, JButton t, JButton enter, JButton altEnter)
  6. buildLabel(JFrame frame, String txt, int x, int y, int w, int h)
  7. buildTxtField(JFrame frame, int x, int y, int w, int h)
  8. calcLocation(JFrame main, JDialog dialog)
  9. calculateMaxMenuItems(JFrame window)