BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Weird JDialog in UI Design

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder IDE
View previous topic :: View next topic  
Author Message
Aven
Guest





PostPosted: Sun Apr 24, 2005 7:57 am    Post subject: Weird JDialog in UI Design Reply with quote



Hi,
My dialog has a weird box on the top-left of the textpane.
The main frame that include the dialog, when switching to
UI design tab, says
a.. Failed to create live value from HistoryDialog historyDialog;: null
b.. Failed to create live visual subcomponent historyDialog as
jmud.HistoryDialog; creating a red component in its place
The source is as follows.
Thanks!

Aven

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;

public class HistoryDialog extends JDialog {
JPanel panel1 = new JPanel();
BorderLayout borderLayout1 = new BorderLayout();
JToolBar jToolBar1 = new JToolBar();
JButton buttonCollapse = new JButton();
JButton buttonClear = new JButton();
JScrollPane jScrollPane1 = new JScrollPane();
JTextPane histPane = new JTextPane();
Document doc = histPane.getDocument();

public HistoryDialog(Frame owner, String title, boolean modal) {
super(owner, title, modal);
try {
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
jbInit();
pack();
} catch (Exception exception) {
exception.printStackTrace();
}
}

public HistoryDialog() {
this(new JFrame(), "", false);
}

private void jbInit() throws Exception {
panel1.setLayout(borderLayout1);
buttonCollapse.setText("Collapse");
buttonCollapse.addActionListener(new
HistoryDialog_buttonCollapse_actionAdapter(this));
buttonClear.setText("Clear");
buttonClear.addActionListener(new
HistoryDialog_buttonClear_actionAdapter(this));
getContentPane().add(panel1);
panel1.add(jToolBar1, java.awt.BorderLayout.NORTH);
jToolBar1.add(buttonCollapse);
jToolBar1.add(buttonClear);
panel1.add(jScrollPane1, java.awt.BorderLayout.CENTER);
jScrollPane1.getViewport().add(histPane);
}

}


Back to top
Kevin Dean [TeamB]
Guest





PostPosted: Mon Apr 25, 2005 2:00 pm    Post subject: Re: Weird JDialog in UI Design Reply with quote



Aven wrote:

Quote:
My dialog has a weird box on the top-left of the textpane.
The main frame that include the dialog, when switching to
UI design tab, says
a.. Failed to create live value from HistoryDialog historyDialog;:
null b.. Failed to create live visual subcomponent historyDialog as
jmud.HistoryDialog; creating a red component in its place
The source is as follows.

You've hit one of my pet peeves with the JBuilder designer: its
insistence on instantiating everything, regardless of whether it is
part of the current design (in jbInit()) or not.

I'm not sure there's much you can do, other than grin and bear it. The
dialog, as an independent entity, should not be included in the frame
and JBuilder should not be instantiating it, but it tries anyway.

If this is causing more problems other than just an annoying error
message, post the code for the frame as well and I'll take a closer
look.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder IDE All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.