hi everyone

I am currently in the process of designing a bank atm machine appliction and I would like to apply a backgrond color to some of the button, I tried some codes but it dont seem to be working, well what I meant was I dont know if the codes I used is the correct form for a background color of a jbutton. I am probably missing codes, can you all tell me if what I have here is the correct thing and could point me in the correct direction here is the codes that I used. do I put it in the cancel button

      `   private void btn_cancelActionPerformed(java.awt.event.ActionEvent evt) {                                           

               do i type the codes inside of here or outside. but these are the codes i usex

        } 

        `                          

or do i type it outside of the cancel actionperformed button

       ` public void run() {
                    try{

                        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

                }catch(Exception e){
                        e.printStackTrace();
                }

                    JButton btn_cancel = new JButton("Cancel");
                    btn_cancel.setBackground(Color.RED);
                    btn_cancel.setContentAreaFilled(false);
                    btn_cancel.setOpaque(true);

                    //JOptionPane.showMessageDialog(null, btn_cancel);

            }

    };
                SwingUtilities.invokeLater(run);
                any help would be appreciated`

hey guys dont bother i figure out how to apply the background color but thanks for 7 views and zero replies

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.