|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
How to access components in multiple frames?Hi,
I am new to junit and i am using the JFCUnit for swing application under eclipse 3.0 IDE. I have an application in which i have one frame and on that frame i have multiple frames. The gui components are present on these multiple frames. Now, how do i test the gui component which is present on that multiple frames. Please suggest me a solution. Thanks Mohit |
|
|
|
|
|
How to access components in multiple frames?Hi Colin,
Thanks for your worthful suggestion. Your response is really appreciable. But still i am facing a problem related to the components i.e. I'm not able to find the particular component from the container. The template of my code looks like this... public class mWindow implements ActionListener { //Button for tool bar public static JButton tHome = new JButton(); public static final JDesktopPane desktop = new JDesktopPane(); JMenuBar mBar = new JMenuBar(); JToolBar tBar = new JToolBar(); //main frame in which all components are attaching public static Jframe mainWindow = new Jframe("Main"); public mWindow() { //Creating a menu bar this.CreateMenuBar(); //add menu bar to main frame mainWindow.setJMenuBar(mBar); //creating a tool bar this.CreateToolBar(); //add tool bar to main frame mainWindow.getContentPane().add(tBar,BorderLayout.NORTH); //adding desktop pane mainWindow.getContentPane().add(desktop,BorderLayout.CENTER); tHome.setEnabled(false); } } Now, in this code what problem i'm facing is that i'm not able to get the reference of the component. Suppose i want to get the reference of ToolBar's button i.e. tHome in my test case but i'm always getting the null value. Whether i try to find the component of ToolBar or MenuBar. Could you please send me solution of this problem. Once again thanks for your worthful suggestion. Thanks Mohit |
| Free embeddable forum powered by Nabble | Forum Help |