package problem

If I create a class Main that imports another class CreateFrame like :

import gui.CreateFrame;

public class Main();

CreateFrame frame = new CreateFrame(800, 600);

pack();

and the gui class :

package gui;

public class CreateFrame() extends JFrame;

SwingUtilities.updateComponentTreeUI(<frame?>);

<frame?>.pack();

how can I refer to the current frame in CreateFrame so I am able to change setting like SwingUtilities.updateComponentTreeUI(<frame?>);

[581 byte] By [appo_neo] at [2007-9-26 1:57:31]
# 1
all objects have a reference to themselves: thisso in CreateFrame you can call:SwingUtilities.updateComponentTreeUI(this); did this answer the question?
audus at 2007-6-29 3:14:12 > top of Java-index,Archived Forums,Java Programming...
# 2

I still get the following error message when I try to compile :

C:\WINNT\Profiles\postma\.java\projects>javac appo/gui/CreateFrame.java

appo/gui/CreateFrame.java:165: updateComponentTreeUI(java.awt.Component) in javax.swing.SwingUtilities cannot

be applied to (appo.gui.CreateFrame.RadioListener)

SwingUtilities.updateComponentTreeUI(this);

Is this mayne referring to something else than the frame ?

appo_neo at 2007-6-29 3:14:12 > top of Java-index,Archived Forums,Java Programming...