473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Problems using setEnabled()

Hey, Im trying to get my gui working but am having a few issues.

I have 3 classes, main, mainWindow, and errorWindow.

the mainWindow is instantiated from main as mainWindow m1 = new MainWindow();

anywho my problem is this....

inside my mainWindow i have a method that creates a new instance of errorWindow, and uses setEnabled() to disable the mainWindow.

at the point, the error window popups saying "you have an error", the window also contains an "ok" button.

what id like to know is how do i reference back from the errorWindow class so that i can set the mainWindow using the setEnabled() method back to true;

Any help would be appreciated.
Thanks
Jul 28 '08 #1
3 1500
r035198x
13,262 8TB
Which classes did you use for your windows?
You sould probably be using a modal Dialog for that error message. It takes care of all the enabling/disabling for you.
Jul 29 '08 #2
JosAH
11,448 Expert 8TB
what id like to know is how do i reference back from the errorWindow class so that i can set the mainWindow using the setEnabled() method back to true;
When you want to invoke a method on an object you need to have a reference
to that object so you can either pass the mainWindow as a parameter to your
errorWindow and possibly store it in your errorWindow for later use.

An alternative is the static method Frame.getFrames(); it returns an array
with all the existing top level frames currently in your application; your mainWindow
is one of them. You can find it by searching for its title.

kind regards,

Jos
Jul 29 '08 #3
Thanks for both of the replies, got it working now.
ill take alook at the dialog model now :)
Jul 29 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Melanie | last post by:
Hallo Ich habe folgendes Problem: In einem JPanel zeige ich mehrere Textfelder und RadioButtons an. Mit den RadioButtons sorge ich dafür, dass das Textfeld welches ausgewählt wurde nicht...
0
by: Jerome Lefebvre | last post by:
Hello, Hope this will interest a few. I been working with a friend on the problems given out during the "International Collegiate Programming Contest" (ICPC) http://icpc.baylor.edu/icpc/ ....
14
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
11
by: JPRoot | last post by:
Hi I wish to set/get a property using System.ComponentModel.ISynchronizeInvoke.Invoke but I cannot find the exact syntax.. Any clue how to do this (right now I am making GetEnabled/SetEnabled...
10
by: BBFrost | last post by:
We just recently moved one of our major c# apps from VS Net 2002 to VS Net 2003. At first things were looking ok, now problems are starting to appear. So far ... (1) ...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
2
by: Mike | last post by:
Hi, I am new to C and having problems with the following program. Basically I am trying to read some files, loading data structures into memory for latter searching. I am trying to use structres...
9
by: =?Utf-8?B?SG93YXJkIFNtaXRo?= | last post by:
I am using VC++ 6.0 (with SP5 installed). When using WinXP this is with SP2 installed. I am developing an instrumentation system comprising a set of networked PCs connected using TCP/IP TCP links....
6
by: rrlveloso09 | last post by:
---code--- if (readOnly) { //cb.disable(); cb.setEnabled(false); } when lower versions of jdk is used (lower than 1.4), the disable() method is working properly (meaning the checkbox...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.