Advertisement
Guest User

Untitled

a guest
Oct 24th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import javax.swing.*;
  2. import java.awt.*;
  3. import java.awt.event.*;
  4.  
  5.  
  6. public class Fret extends JButton implements ActionListener{
  7.     public String note;
  8.     public String scaleRoot;
  9.     public Fret(String fretNote){
  10.         this.note= fretNote;
  11.         this.setFont(new Font("Arial", Font.PLAIN, 10));
  12.         this.setMargin(new Insets(0,0,0,0));
  13.         setText(note);
  14.         addActionListener(this);
  15.     }
  16.  
  17.     public void actionPerformed(ActionEvent e) {
  18.         if(e.getSource() == this){
  19.             scaleRoot = this.note;
  20.             System.out.println(scaleRoot);
  21.         }
  22.        
  23.     }
  24.    
  25.    
  26.    
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement