Dialog.setBackground Does Not Work
The Dialog background gets reset when the dialog is being prepared for display, so your call to setBackground (or setForeground) in the constructor won't have an effect. You can fix it with a hook into the addNotify method of your Dialog class:
public void addNotify()
{
super.addNotify();
setBackground(Color.red);
}
Add notify creates the peer object. You are hooking your code in right after the peer gets created.You also need to explicitly control the background of each component. Inheriting it from the Dialog will just give gray.
FAQ Home
Sponsored links
Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.
Check Out IT Certification Preparation Materials
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
Sign Up With SkillSoft & Get Access to Training Materials for Over 50 Professional Certifications.
SFTP components for .NET
Add complete SSH and SFTP support to your .NET framework application
Add complete SSH and SFTP support to your .NET framework application
Virtual File System SDK
Create your own file systems in Windows and .NET applications
Create your own file systems in Windows and .NET applications
PureCM Software Configuration Management
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
Version control and integrated issue tracking - powerful and easy to use. Get your FREE trial now!
