equal
deleted
inserted
replaced
10 |
10 |
11 import java.lang.System |
11 import java.lang.System |
12 import java.awt.Component |
12 import java.awt.Component |
13 import javax.swing.JOptionPane |
13 import javax.swing.JOptionPane |
14 |
14 |
15 import scala.swing.ComboBox |
15 import scala.swing.{ComboBox, TextArea, ScrollPane} |
16 import scala.swing.event.SelectionChanged |
16 import scala.swing.event.SelectionChanged |
17 import scala.collection.mutable |
17 import scala.collection.mutable |
18 |
18 |
19 |
19 |
20 object Library |
20 object Library |
128 } |
128 } |
129 |
129 |
130 |
130 |
131 /* simple dialogs */ |
131 /* simple dialogs */ |
132 |
132 |
|
133 def scrollable_text(txt: String, width: Int = 76, editable: Boolean = false): ScrollPane = |
|
134 { |
|
135 val text = new TextArea(txt) |
|
136 if (width > 0) text.columns = width |
|
137 text.editable = editable |
|
138 new ScrollPane(text) |
|
139 } |
|
140 |
133 private def simple_dialog(kind: Int, default_title: String, |
141 private def simple_dialog(kind: Int, default_title: String, |
134 parent: Component, title: String, message: Seq[Any]) |
142 parent: Component, title: String, message: Seq[Any]) |
135 { |
143 { |
136 Swing_Thread.now { |
144 Swing_Thread.now { |
137 val java_message = message map { case x: scala.swing.Component => x.peer case x => x } |
145 val java_message = message map { case x: scala.swing.Component => x.peer case x => x } |