diff options
author | Christopher Baines <cbaines8@gmail.com> | 2012-03-23 19:53:39 +0000 |
---|---|---|
committer | Christopher Baines <cbaines8@gmail.com> | 2012-03-23 19:53:39 +0000 |
commit | 07463d527777147532167e7f825367eee2f2837b (patch) | |
tree | e096dbfa9caf65eb6189df84b80e71ee234b3f63 /src/net/cbaines/suca | |
parent | 1749f7edc11b9961b15e790c7d296bacd8d68ff5 (diff) | |
download | southampton-university-calendar-applet-07463d527777147532167e7f825367eee2f2837b.tar southampton-university-calendar-applet-07463d527777147532167e7f825367eee2f2837b.tar.gz |
Added preview text area.
Diffstat (limited to 'src/net/cbaines/suca')
-rw-r--r-- | src/net/cbaines/suca/CalendarApplet.java | 20 |
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); |