9 package micropolisj.gui;
11 import java.util.ResourceBundle;
13 import javax.swing.JTextPane;
14 import javax.swing.text.BadLocationException;
15 import javax.swing.text.StyledDocument;
17 import micropolisj.engine.MicropolisMessage;
20 static ResourceBundle cityMessageStrings = ResourceBundle.getBundle(
"micropolisj.CityMessages");
27 appendMessageText(cityMessageStrings.getString(message.name()));
30 void appendMessageText(String messageText) {
32 StyledDocument doc = getStyledDocument();
33 if(doc.getLength() != 0) {
34 doc.insertString(doc.getLength(),
"\n", null);
36 doc.insertString(doc.getLength(), messageText, null);
38 catch(BadLocationException e) {
39 throw new Error(
"unexpected", e);