Respuesta :

ijeggs

Answer:

JPanel PayrollPanel=new JPanel();

JButton saveButton=new JButton("Save");

A full code snippet and screen shot is provided in the explanation section

Explanation:

import java.awt.*;

import javax.swing.*;

public class TestClass {

   TestClass()  {

       JFrame f= new JFrame("Payroll Panel");

       JPanel payrollPanel=new JPanel();

       payrollPanel.setBounds(10,20,200,200);

       payrollPanel.setBackground(Color.gray);

       JButton saveButton=new JButton("Save");

       saveButton.setBounds(50,100,80,30);

       saveButton.setBackground(Color.yellow);

       payrollPanel.add(saveButton);

       f.add(payrollPanel);

       f.setSize(400,400);

       f.setLayout(null);

       f.setVisible(true);

   }

   public static void main(String args[]) {

       new TestClass();

   }

}

Ver imagen ijeggs

Otras preguntas