JDK-4140421 : There is no way to control the title for JToolBar tear-out frames
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.0,1.3.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 1998-05-20
  • Updated: 1999-06-24
  • Resolved: 1999-06-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.3.0 betaFixed
Related Reports
Duplicate :  
Relates :  
Description

Name: rk38400			Date: 05/20/98


There should be a way to control the name
that gets displayed as the title of a
JToolBar when it is "undocked" from the
main window of an application.  Currently,
the only title that gets displayed is
"AWTapp" which is hardly useful for real
applications.
(Review ID: 30741)
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: kestrel-beta FIXED IN: kestrel-beta INTEGRATED IN: kestrel-beta
14-06-2004

WORK AROUND This example shows how you can set the title of the toolbar frame... import java.awt.event.*; import javax.swing.*; class FrameTest extends JFrame { public FrameTest(String s) { super(s); } public void init() { JMenuBar mb = new JMenuBar(); JMenu menu = mb.add(new JMenu("File")); menu.add("New"); menu.add("Open"); menu.add("Save"); setJMenuBar(mb); JToolBar tb = new KToolBar("My ToolBar!"); tb.add(new JButton(new ImageIcon("images/new.gif"))); tb.add(new JButton(new ImageIcon("images/open.gif"))); tb.add(new JButton(new ImageIcon("images/save.gif"))); tb.addSeparator(); tb.add(new JButton(new ImageIcon("images/cut.gif"))); tb.add(new JButton(new ImageIcon("images/paste.gif"))); getContentPane().add(tb, BorderLayout.NORTH); TextArea ta = new TextArea(); getContentPane().add(ta, BorderLayout.CENTER); setSize(200,200); setVisible(true); } class KToolBar extends JToolBar { KToolBar(String s) { setName(s); setLayout( new BoxLayout( this, BoxLayout.X_AXIS ) ); updateUI(); } } public static void main (String[] args) { FrameTest test = new FrameTest("Name"); test.init(); } }
11-06-2004

EVALUATION This is true. It would make sense to use the 'name' of the toolbar. An easy fix. georges.saab@Eng 1998-05-20 Strangely enough, the code DOES use the name of the toolbar when creating the frame that is used to house the toolbar. I'll need to check into it further to see why this is not working correctly (I can't right now because the build is broken...) georges.saab@Eng 1998-09-11 OK, this happens because the frame gets created in the constructor before the name of the toolbar can be set (and the frame does not listen for the name property of the toolbar chaging and updating its title accordingly). That is the 'right' solution for the long run. For the short term, I have added a workaround to the Work Around field of this bug report and sent it ot the submitter. georges.saab@Eng 1998-09-11 For Kestrel (1.3), a constructor has been added which allows you to set the name when creating a JToolBar instance. georges.saab@Eng 1999-06-01
11-09-1998