aboutsummaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2012-03-23 19:53:39 +0000
committerChristopher Baines <cbaines8@gmail.com>2012-03-23 19:53:39 +0000
commit07463d527777147532167e7f825367eee2f2837b (patch)
treee096dbfa9caf65eb6189df84b80e71ee234b3f63 /src/net
parent1749f7edc11b9961b15e790c7d296bacd8d68ff5 (diff)
downloadsouthampton-university-calendar-applet-07463d527777147532167e7f825367eee2f2837b.tar
southampton-university-calendar-applet-07463d527777147532167e7f825367eee2f2837b.tar.gz
Added preview text area.
Diffstat (limited to 'src/net')
-rw-r--r--src/net/cbaines/suca/CalendarApplet.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/net/cbaines/suca/CalendarApplet.java b/src/net/cbaines/suca/CalendarApplet.java
index f9de766..0357bbf 100644
--- a/src/net/cbaines/suca/CalendarApplet.java
+++ b/src/net/cbaines/suca/CalendarApplet.java
@@ -60,6 +60,11 @@ public class CalendarApplet extends JApplet {
private JPanel calendarCreationPanel;
+ private JPanel calendarCreationOptions;
+
+ // This is more of a development feature....?
+ private JTextArea calendarPreviewTextArea;
+
public void init() {
// Execute a job on the event-dispatching thread:
// creating this applet's GUI.
@@ -130,7 +135,9 @@ public class CalendarApplet extends JApplet {
stageTabbedPane.addTab("Calendar Fetch", csvFileFetchPanel);
// Calendar creation panel
- calendarCreationPanel = new JPanel();
+ calendarCreationPanel = new JPanel(new GridLayout(1, 2));
+
+ calendarCreationOptions = new JPanel();
JButton createCalendarButton = new JButton("Create Calendar");
createCalendarButton.addActionListener(new ActionListener() {
@@ -143,6 +150,7 @@ public class CalendarApplet extends JApplet {
try {
Calendar calendar = builder.build(new StringReader(calendarCSVString));
calendarICALString = calendar.toString();
+ calendarPreviewTextArea.setText(calendarICALString);
System.out.println(calendarICALString);
} catch (ParserException e) {
e.printStackTrace();
@@ -151,7 +159,7 @@ public class CalendarApplet extends JApplet {
}
}
});
- calendarCreationPanel.add(createCalendarButton);
+ calendarCreationOptions.add(createCalendarButton);
JButton saveCalendarButton = new JButton("Save Calendar");
saveCalendarButton.addActionListener(new ActionListener() {
@@ -174,7 +182,13 @@ public class CalendarApplet extends JApplet {
}
});
- calendarCreationPanel.add(saveCalendarButton);
+ calendarCreationOptions.add(saveCalendarButton);
+
+ calendarCreationPanel.add(calendarCreationOptions);
+
+ calendarPreviewTextArea = new JTextArea();
+
+ calendarCreationPanel.add(new JScrollPane(calendarPreviewTextArea));
stageTabbedPane.addTab("Calendar Creation", calendarCreationPanel);