Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Application is fine in prompt line but in the JSW does not work

843802Jan 12 2006 — edited Jan 13 2006
Hi folks

I have a stuck problem with my application. It works fine with java ... but does not work with the javaws! The problem is in a inner class who extends a panel which must be painted several times (the application works with a optimazation traffic algorithm)... If i use the inner class, the program does not appear and there is no bug messages.

If a cut the lines with the drawingPane code, the application run without a problem with the javaws!

These are the important lines of the code:

// Main class
public class AlgConstrutivos extends JPanel
implements MouseListener, ActionListener{
...
// The problem PANEL!!!!!!!!!!
private JPanel drawingPane;

...
// The constructor of main class
public AlgConstrutivos() {
...
drawingPane = new DrawingPane();
drawingPane.setBackground(Color.white);
drawingPane.addMouseListener(this);

//Put the drawing area in a scroll pane.
JScrollPane scroller = new JScrollPane(drawingPane);
scroller.setPreferredSize(new Dimension(400,400));

//Lay out
add(ordem, BorderLayout.PAGE_START);
add(scroller, BorderLayout.CENTER);
...

// The main function
public static void main(String[] args) {
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Create and set up the content pane.
JComponent newContentPane = new AlgConstrutivos();
newContentPane.setOpaque(true);
frame.setContentPane(newContentPane);

//Display the window.
frame.pack();
frame.setVisible(true);
}

public class DrawingPane extends JPanel {
public void paintComponent(Graphics g) {
super.paintComponent(g);
// Draw some lines and points...
}
}

Any help?

Thanks...

Andre Cordenonsi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 10 2006
Added on Jan 12 2006
3 comments
165 views