Results 1 to 9 of 9
- 03-14-2009, 10:44 AM #1
Member
- Join Date
- Mar 2009
- Posts
- 6
- Rep Power
- 0
Repositioning An unwanted JInternalFrame
Hello to all.
We start from what I've done and After from what does not work.
So, in practice, I created a JScrollPane with an JDesktopPane which in turn contains a JTable and JInternalFrame to a higher level.
The layout as JDesktopPane uses the FormLayout and JInternalFrame is added with the following CellConstraints:
Everything works perfectly except that after moving the JInternalFrame within JDesktopPane, they are again placed in their original position every time you go out with the mouse outside the JDesktopPane.Java Code:new CellConstraints(1, 1, CellConstraints.LEFT, CellConstraints.TOP)
Why this happen?
Which method that is called?
How can I avoid this?
Thanks to everyone for any reply.
-
This is because (as you have been told numerous times in the forums.sun.com and yet refuse to believe) you are changing the JDesktoPane's layout from null to something else. You can ask this question in a thousand fora and it still won't change the problem or its solution. You need help.
- 03-14-2009, 05:07 PM #3
Member
- Join Date
- Mar 2009
- Posts
- 6
- Rep Power
- 0
If I set the null layout does not work no nothing.
Disappear the JScrollpane and JInternalFrame.
-
- 03-15-2009, 09:18 PM #5
Member
- Join Date
- Mar 2009
- Posts
- 6
- Rep Power
- 0
The code in question is this:
Java Code:JList rowHeader = new JList(lm); rowHeader.setBorder(new LineBorder(Color.black, 1, false)); rowHeader.setFocusable(false); rowHeader.setFixedCellHeight(100); final JScrollPane scrollPane = new JScrollPane(); scrollPane.setRowHeaderView(rowHeader); scrollPane.setBounds(10, 10, 1237, 539); panelApp.add(scrollPane); desktopPane = new JDesktopPane(); desktopPane.setLayout(new FormLayout("1150px", "1900px")); desktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); scrollPane.setViewportView(desktopPane); final AppointmentTableModel aTm = new AppointmentTableModel(cal.getDate().getTime()); //extends AbstractTableModel table = new JTable(aTm); table.setShowHorizontalLines(false); table.setFocusable(false); for (int i = 0; i < 7; i++) table.getColumnModel().getColumn(i).setPreferredWidth(180); table.setRowHeight(100); table.setRowSelectionAllowed(false); table.getTableHeader().setReorderingAllowed(false); scrollPane.setColumnHeaderView(table.getTableHeader()); desktopPane.add(table, new CellConstraints("1, 1, 1, 1, left, fill")); addAppointmentInternalFrame(System.currentTimeMillis()); //add the JInternalFrame
-
I suggest that you delete this line:
and this line:Java Code:desktopPane.setLayout(new FormLayout("1150px", "1900px"));
and that you instead place your JTable into a JScrollPane if desired, place that JScrollPane into a JInternalFrame, set the JInternalFrame's bounds via setBounds to some reasonable size and location and then add the JInternalFrame to the desktopPane container. Hopefully then you'll see what you need to see.Java Code:desktopPane.add(table, new CellConstraints("1, 1, 1, 1, left, fill"));
-
For anyone interested, here's a link to the other thread on the forums.sun.com: Swing - JInternalFrame Inside A Strange JDesktoPane
- 03-15-2009, 09:40 PM #8
Member
- Join Date
- Mar 2009
- Posts
- 6
- Rep Power
- 0
The idea of putting the table inside a JInternalFRame is very good.
Thank you.
- 03-18-2009, 09:42 PM #9
Member
- Join Date
- Mar 2009
- Posts
- 6
- Rep Power
- 0
Similar Threads
-
Problem with JInternalFrame
By hameem in forum AWT / SwingReplies: 1Last Post: 12-11-2008, 04:23 PM -
[SOLVED] jScrool in JInternalFrame
By gustio in forum New To JavaReplies: 2Last Post: 07-22-2008, 10:05 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks