Created
May 29, 2012 08:48
-
-
Save anonymous/2823353 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.* | |
import javax.swing.* | |
class Window(t: String,frash:FrashCard) extends JFrame(t){ | |
val frashCard = frash | |
val panel:JPanel = new JPanel(new GridLayout(1,1)) | |
val tit = t | |
makeWindow(); | |
add(panel) | |
def this() = this("FrashCard",new FrashCard) | |
def makeWindow(){ | |
setSize(500,500) | |
setTitle(tit) | |
setLayout(new GridLayout) | |
setLocationRelativeTo(null); | |
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) | |
addMouseListener( | |
new MouseListener{ | |
def mouseClicked(event:MouseEvent){ | |
addString (frashCard goNext) | |
} | |
def mousePressed(event:MouseEvent){} | |
def mouseReleased(event:MouseEvent){} | |
def mouseEntered(event:MouseEvent){} | |
def mouseExited(event:MouseEvent){} | |
} | |
) | |
println("Window made!") | |
} | |
def addString(word:String){ | |
println("called! " + word) | |
panel.add(new JLabel(word)) | |
repaint() | |
println("repainted") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment