Topic
  • 1 reply
  • Latest Post - ‏2007-06-12T15:48:58Z by Stan
SystemAdmin
SystemAdmin
1525 Posts

Pinned topic "Problem With JScrollPane on JDesktopPane object when interacting with derby server"

‏2007-06-12T07:22:25Z |
would you please assist me on this problem that i've been trying to solve but i don't seem to get it right!!
I developed a derby database and am using java application to maintain it but i have the problem to get a scrollpane working with a desktopPane. i would appreciate if someone could assist me on this problem!!

my brief code looks like this:

// set up desktop
desktop = new JDesktopPane();
desktop.setBackground( Color.CYAN );
JScrollPane scrollPane = new JScrollPane(desktop,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS );

//scrollPane.add(desktop);

// get the content pane to set up GUI
Container c = getContentPane();
c.removeAll();
c.add( clientToolBar, BorderLayout.NORTH );
c.add( scrollPane, BorderLayout.CENTER );

// Private inner class defines action that enables
// user to input new entry. User must "Save" entry
// after inputting data.
private class NewClientAction extends AbstractAction {

// set up action's name, icon, descriptions and mnemonic
public NewClientAction()
{
putValue( NAME, "New" );
putValue( SMALL_ICON, new ImageIcon(
getClass().getResource( "images/New24.png" ) ) );
putValue( SHORT_DESCRIPTION, "New Client" );
putValue( LONG_DESCRIPTION,
"Add a new test data entry" );
putValue( MNEMONIC_KEY, new Integer( 'N' ) );
}

// display window in which user can input entry
public void actionPerformed( ActionEvent e )
{
// create new internal window
TestDataEntryFrame entryFrame =
createTestDataEntryFrame();

// set new AddressBookEntry in window
entryFrame.setTestDataEntry(
new TestDataEntry() );

// display window
desktop.add( entryFrame );
entryFrame.setVisible( true );
}

} // end inner class NewAction
i would appreciate you urgent help coz my client is waiting for the product...

regards

Lameck
Updated on 2007-06-12T15:48:58Z at 2007-06-12T15:48:58Z by Stan
  • Stan
    Stan
    267 Posts

    Re: "Problem With JScrollPane on JDesktopPane object when interacting with derby server"

    ‏2007-06-12T15:48:58Z  
    Hi -

    I don't see any Derby information or errors to comment on, only application code. I'd be glad to evaluate any Derby messages, exceptions or behavior if you would share them. If you feel the problem is with the code itself I recommend posting to a SWING forum.