Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.*;
- public class Fret extends JButton implements ActionListener{
- public String note;
- public String scaleRoot;
- public Fret(String fretNote){
- this.note= fretNote;
- this.setFont(new Font("Arial", Font.PLAIN, 10));
- this.setMargin(new Insets(0,0,0,0));
- setText(note);
- addActionListener(this);
- }
- public void actionPerformed(ActionEvent e) {
- if(e.getSource() == this){
- scaleRoot = this.note;
- System.out.println(scaleRoot);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement