 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Aven Guest
|
Posted: Sun Apr 24, 2005 7:57 am Post subject: Weird JDialog in UI Design |
|
|
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
|
Posted: Mon Apr 25, 2005 2:00 pm Post subject: Re: Weird JDialog in UI Design |
|
|
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 |
|
 |
|
|
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
|
|