Article View: borland.public.jbuilder.java.swing
Article #11838The Dreaded Red Bean
From: John Hines
Date: Thu, 01 Apr 1999 00:00
Date: Thu, 01 Apr 1999 00:00
54 lines
2306 bytes
2306 bytes
New job. I'm using some inherited code under JBuilder 2.01 ond JDK 1.2.1.
(Although I got the same results from JDK 1.2.) The class BaseTabPanel
shows as a red bean in the designer but the program compiles and runs as
expected. What's happening?
John Hines
//FYI
//H2. Visual Design Tools and JavaBeans
//-------------------------------------
//* If you see one of your components as a red box with its class name at
//the top, JBuilder has not been able to create an instance of that
component for
//the designer. This is called a "Red Bean". Some reasons you might see a
Red
//Bean are:
// 1) That class has no default (parameterless) constructor
// 2) That class threw exceptions on every constructor JBuilder tried
// 3) That class is the 'this' object and it extends an abstract class
//Don't see how any of these apply
package com.sequel.care.gui;
import java.awt.*;
import javax.swing.JPanel;
public class BaseTabPanel extends JPanel{
BaseModel model;
BaseTabPanel( ) { }
BaseTabPanel( BaseModel model ) { this.model = model; }
String getTitle() { return "unknown"; }
}
public class BaseModel
{
Server theServer;
void retrieveData() { }
void saveData() { }
public BaseModel() { }
public BaseModel(Server server) { theServer = server; }
}
public class Server
{
int index;
Server() { index = 0; }
void reset() { index = 0; }
BaseTabPanel getNextScreen() {
BaseTabPanel next = null;
switch (index) {
case 0: next = new NewCallPanel(new BaseModel(this));
break;
case 1: ...
default:
}
index++;
return next;
}
}
Technical Details
Message-ID:
<7e0n2h$fci3@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,f0b3aa7e075fc773,start X-Google-Attributes: gid111d45,public From: "John Hines" <jrhines@onramp.net> Subject: The Dreaded Red Bean Date: 1999/04/01 Message-ID: <7e0n2h$fci3@forums.borland.com> X-Deja-AN: 461708751 Organization: Another Netscape Collabra Server User X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: borland.public.jbuilder.java.swing