From 738337b5b3f928ae27e687dfdebea96ef6a325c5 Mon Sep 17 00:00:00 2001 From: Roland Andersson Date: Wed, 7 May 2003 04:32:09 +0000 Subject: [PATCH] no message --- MooTrackView.java | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/MooTrackView.java b/MooTrackView.java index ed2bcc6..d9fe942 100644 --- a/MooTrackView.java +++ b/MooTrackView.java @@ -19,18 +19,17 @@ import java.awt.*; public class MooTrackView extends JPanel{ private MooTrackTitle title; - private noteView notes; + private JScrollPane table; /** * Creates */ public MooTrackView () { this.addMouseMotionListener(doScrollRectToVisible); - setLayout(new GridLayout(2,0)); - notes = new noteView(); - - add(trackTitle()); - add(noteEdit()); + setLayout(new BorderLayout()); + this.setBorder(BorderFactory.createLineBorder(Color.black)); + add(trackTitle(), BorderLayout.NORTH); + add(noteView(), BorderLayout.SOUTH); } MouseMotionListener doScrollRectToVisible = new MouseMotionAdapter() { @@ -41,27 +40,23 @@ public class MooTrackView extends JPanel{ }; private JPanel trackTitle () { - setPreferredSize(new Dimension(PANEL_WIDTH, TITLE_HEIGHT)); title = new MooTrackTitle(); + title.setPreferredSize(new Dimension(PANEL_WIDTH, TITLE_HEIGHT)); + title.setBorder(BorderFactory.createLineBorder(Color.black)); return title; } - - private JPanel noteEdit () { - setPreferredSize(new Dimension(PANEL_WIDTH, NOTEVIEW_HEIGHT)); - notes = new noteView(); - notes.setBackground(Color.white); - notes.setBorder(BorderFactory.createLineBorder(Color.black)); - return notes; - } - - class noteView extends JPanel { - public noteView () { - setLayout(new FlowLayout()); + + private JScrollPane noteView() { + JScrollPane scrollPane = new JScrollPane(table); + table.setPreferredScrollableViewportSize(new Dimension(500, 70)); + return scrollPane; } + } - } private static final int PANEL_WIDTH = 65; - private static final int TITLE_HEIGHT = 50; + private static final int TITLE_HEIGHT = 20; private static final int NOTEVIEW_HEIGHT = 200; + private static final int BOX_WIDTH = 20; + private static final int BOX_HEIGHT = 20; } -- 2.39.2