Scala - A simple Scala/Swing application Code Example

The code for A simple Scala/Swing application

import java.awt.BorderLayout
import java.awt.Dimension
import javax.swing.JFrame
import javax.swing.JScrollPane
import javax.swing.JTextArea

object SwingExample extends App {
    val TextArea = new JTextArea("Welcome at IncludeHelp")
    val ScrollPane = new JScrollPane(TextArea)

    val frame = new JFrame("Hello Friends!")
    frame.getContentPane.add(ScrollPane, BorderLayout.CENTER)
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
    frame.setSize(new Dimension(600, 400))
    frame.setLocationRelativeTo(null)
    frame.setVisible(true)
}
Code by IncludeHelp, on August 10, 2022 22:22

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.