How can I make a Panel's Title Wordwrap?

Is there a way to make a panel's title be multiline? I've got a panel where the title is dynamic. I don't know how long the title will be. As it works now, the the title occaisionally gets cut-off. Is there a way to wordwrap a panel's title?
<mx:Panel id="mySchoolPanel" " 
          title="{myTitle}"
         width="230"
         x="710" y="150"
         headerHeight="50" >
Thank you.
-Laxmidi

The layout logic of Panel appears to assume a single line of text in the title, so to get word-wrapping you may need to extend the class. I had a go at it below - will probably need some tweaking:
package
    import mx.containers.Panel;
    public class WrappingPanel extends Panel
        // Hard coded padding above and below title text. Should be broken-out
        // into a style.
        private static const HEADER_PADDING : int = 6;
        protected override function createChildren():void
            super.createChildren();
            titleTextField.wordWrap = true;
        protected override function getHeaderHeight():Number
            // Set the header height dynamically based on the height of the title
            return titleTextField.measuredHeight + HEADER_PADDING * 2;
        protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
            super.updateDisplayList( unscaledWidth, unscaledHeight );
            // Set the height of the title to fit all text
            titleTextField.height = titleTextField.measuredHeight;
            // Position the title
            titleTextField.y = HEADER_PADDING;

Similar Messages

  • How can I make CS6 panels "sticky"?

    This is probably a very basic question.  In the previous versions of Photoshop I've used (CS3, CS5), when I opened multiple panels (e.g. History, Info, etc) they would all stay open for reference.  However with CS6 I've noticed that if I have, say, the History panel open, and also open, say, Info, then the History panel closes.
    How can I change this behavior such that each panel I open will stay open and visible until I direct it otherwise?  It's frustrating to have to keep using Window->History (or whatever) each time I need to see one or the other.
    Thanks!

    Hi,
    Te only thing you need to do is that , just click on the arrows that says "Expand Panels". By looking at your query it seems that currently you have the panels collapsed.
    If the panels are collapsed they wont remain open, but they gets hidden and then you have to click on the icons related to each panel.
    To overcome this, just Expand Panels and then every panel that you may open will behave as you needed.
    Please find the arrow in the image below :
    Hope it helps !!
    Thanks,
    Baljeet

  • How can I make disapear Windows title bar?

    Helo all,
    I'm actually working on an AIR application and I would like
    to know how can I make disapear the Windows title bar (with the
    "close", "minimize", "full screen" buttons) like it is in
    kuler.
    thanks for your help ^^

    Hi, in order to have the best chance of getting an answer, I
    suggest you repost on the
    AIR
    forum
    :-) Sami

  • How can I make a title (text) on a postcard vertical not horizontal text?

    How can I make a title (text) on a postcard layout vertical not horizontal text?

    Insert it in a Text Box then rotate this one.
    Yvan KOENIG (VALLAURIS, France) lundi 13 juin 2011 16:20:28
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
    Please : Search for questions similar to your own
    before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How can I make the spry accordion remember the panel open when I refresh the page or jump to a new page?

    How can I make the spry accordion remember the panel open
    when I refresh the page or jump to a new page?
    I am using the accordion feature on all my pages as a
    navigation aid. It has three panels. When you refresh the page the
    panel goes back to the default pane... Is there a way of
    controlling this so that the browser can remember the pane that is
    open (say set a variable, cookie, other?)

    Look for "Set the default open panel" on the following page:
    http://labs.adobe.com/technologies/spry/articles/accordion_overview/index.html
    Keep in mind you would need to change that bit of code on
    every page. The only way to do it more dynamically would be to
    include a custom javascript or PHP/ASP style script in order to
    change the value.

  • How can I make a global change so all controls and indicators labels on the front panel change to another colour?

    How can I make a global change so all controls and indicators labels on the front panel change to another colour?
    I need to change the front panel so that it can be used in a dark environment.

    Hi
    The only way I see, is to use the "Controls[]" property and iterate through all of them. But don't forget about nested elements (i.e. clusters, tab-controls, ...).
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • How can i make it so every time i save something the date is included in the title?

    how can i make it so every time i save something the date is included in the title?

    More information would be helpful. Are you doing this in an application? If so, what application.

  • Hi, how can I make titles in premiere elements with coloured schadows????????

    Hi, how can I make titles with coloured schadows in premiere elements????????

    narrowcaster47
    What version of Premiere Elements are you using and on what computer operating system is it running?
    Are you looking for text whose fill is a 4- color gradient instead of a solid color. Or something else, like text whose fill is a still or video?
    Answers are in the details. So, please, more details so I can fine tune a reply to your question.
    Thank you.
    ATR

  • How can I make Acrobat Pro XI open by default to thumbnails view (Pages Panel & Pages)?

    How can I make Acrobat Pro XI open by default to thumbnails view (Pages Panel & Pages) without changing the properties on every single pdf?

    Not possible. This is a file-specific setting, not an application-wide
    setting.

  • Somehow I created a live copy of "Finder" on my desktop.  It is titled "iPhoto Library", and has live copies of all of my files/photos/music.  How can I make it go away without deleting all of my content?

    Somehow I created a live copy of "Finder" on my desktop.  It is titled "iPhoto Library", and has live copies of all of my files/photos/music.  How can I make it go away without deleting all of my content?

    Either you moved or copied your iPhoto library folder to the Desktop.
    Quit iPhoto. Rename the folder on your Desktop to something else, such as "foo." Launch iPhoto. If you still see all your photos, you can delete "foo."
    If you don't see your photos, quit iPhoto, rename "foo" to "iPhoto Library," and put it in your Pictures folder. Try iPhoto again.

  • How can I make the combo box turn to the value of black.

    When the show button is pressed (and not before), a filled black square should be
    displayed in the display area. The combo box (or drop down list) that enables the user to choose the colour of
    the displayed shape and the altering should take effect immediately.When the show button is pressed,
    the image should immediately revert to the black square, the combo box should show the value that
    correspond to the black.
    Now ,the problem is: after I pressed show button, the image is reverted to the black square,but I don't know
    how can I make the combo box turn to the value of black.
    Any help or hint?Thanks a lot!
    coding 1.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class test extends JFrame {
         private JPanel buttonPanel;
         private DrawPanel myPanel;
         private JButton showButton;
         private JComboBox colorComboBox;
    private boolean isShow;
         private int shape;
         private boolean isFill=true;
    private String colorNames[] = {"black", "blue", "cyan", "darkGray", "gray",
    "green", "lightgray", "magenta", "orange",
    "pink", "red", "white", "yellow"}; // color names list in ComboBox
    private Color colors[] = {Color.black, Color.blue, Color.cyan, Color.darkGray,
                              Color.gray, Color.green, Color.lightGray, Color.magenta,
                              Color.orange, Color.pink, Color.red, Color.white, Color.yellow};
         public test() {
         super("Draw Shapes");
         // creat custom drawing panel
    myPanel = new DrawPanel(); // instantiate a DrawPanel object
    myPanel.setBackground(Color.white);
         // set up showButton
    // register an event handler for showButton's ActionEvent
    showButton = new JButton ("show");
         showButton.addActionListener(
              // anonymous inner class to handle showButton events
         new ActionListener() {
                   // draw a black filled square shape after clicking showButton
         public void actionPerformed (ActionEvent event) {
                             // call DrawPanel method setShowStatus and pass an parameter
              // to decide if show the shape
         myPanel.setShowStatus(true);
                   isShow = myPanel.getShowStatus();
                                            shape = DrawPanel.SQUARE;
                        // call DrawPanel method setShape to indicate shape to draw
                                            myPanel.setShape(shape);
                        // call DrawPanel method setFill to indicate to draw a filled shape
                                            myPanel.setFill(true);
                        // call DrawPanel method draw
                                            myPanel.draw();
                             myPanel.setFill(true);
                             myPanel.setForeground(Color.black);
                   }// end anonymous inner class
         );// end call to addActionListener
    // set up colorComboBox
    // register event handlers for colorComboBox's ItemEvent
    colorComboBox = new JComboBox(colorNames);
    colorComboBox.setMaximumRowCount(5);
    colorComboBox.addItemListener(
         // anonymous inner class to handle colorComboBox events
         new ItemListener() {
         // select shape's color
         public void itemStateChanged(ItemEvent event) {
         if(event.getStateChange() == ItemEvent.SELECTED)
         // call DrawPanel method setForeground
         // and pass an element value of colors array
         myPanel.setForeground(colors[colorComboBox.getSelectedIndex()]);
    myPanel.draw();
    }// end anonymous inner class
    ); // end call to addItemListener
    // set up panel containing buttons
         buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(4, 1, 0, 50));
         buttonPanel.add(showButton);
    buttonPanel.add(colorComboBox);
    JPanel radioButtonPanel = new JPanel();
    radioButtonPanel.setLayout(new GridLayout(2, 1, 0, 20));
    Container container = getContentPane();
    container.setLayout(new BorderLayout(10,10));
    container.add(myPanel, BorderLayout.CENTER);
         container.add(buttonPanel, BorderLayout.EAST);
    setSize(500, 400);
         setVisible(true);
         public static void main(String args[]) {
         test application = new test();
         application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    coding 2
    import java.awt.*;
    import javax.swing.*;
    public class DrawPanel extends JPanel {
         public final static int CIRCLE = 1, SQUARE = 2;
         private int shape;
         private boolean fill;
         private boolean showStatus;
    private int shapeSize = 100;
    private Color foreground;
         // draw a specified shape
    public void paintComponent (Graphics g){
              super.paintComponent(g);
              // find center
    int x=(getSize().width-shapeSize)/2;
              int y=(getSize().height-shapeSize)/2;
              if (shape == CIRCLE) {
         if (fill == true){
         g.setColor(foreground);
              g.fillOval(x, y, shapeSize, shapeSize);
    else{
                   g.setColor(foreground);
    g.drawOval(x, y, shapeSize, shapeSize);
              else if (shape == SQUARE){
         if (fill == true){
         g.setColor(foreground);
                        g.fillRect(x, y, shapeSize, shapeSize);
    else{
                        g.setColor(foreground);
    g.drawRect(x, y, shapeSize, shapeSize);
    // set showStatus value
    public void setShowStatus (boolean s) {
              showStatus = s;
         // return showstatus value
    public boolean getShowStatus () {
              return showStatus;
         // set fill value
    public void setFill(boolean isFill) {
              fill = isFill;
         // set shape value
    public void setShape(int shapeToDraw) {
              shape = shapeToDraw;
    // set shapeSize value
    public void setShapeSize(int newShapeSize) {
              shapeSize = newShapeSize;
    // set foreground value
    public void setForeground(Color newColor) {
              foreground = newColor;
         // repaint DrawPanel
    public void draw (){
              if(showStatus == true)
              repaint();

    Hello,
    does setSelectedIndex(int anIndex)
    do what you need?
    See Java Doc for JComboBox.

  • How can I make a rule to mark all messages sent to Mail Trash as Read?

    How can I make a rule to mark all messages sent to Mail Trash as Read?
    When I look at some emails on my phone, I can see from the title that I don't need to read the email so I delete it without opening it. When I go to my Macbook Pro and open mail, the number of unread messages in my Trash shows next to the name. It drives me nuts. Can I just set a rule to mark all messages sent to trash as read? If that isn't possible, I'd take just making the number not show beside the Trash folder.

    Just in the case that I actually do need to go back to them for some reason. I have some OCD tendencies which is also why the number beside the folder drives me nuts.

  • How can i make a transition between clips on cutaway?

    how can i make a transition between clips on cutaway?

    ninafromlisboa wrote:
    But if I want ONLY fade out (or in) I can't do it...
    OK, I understand what you mean now! I assumed you were asking about the normal Fade In or Fade Out using the transition from the Transitions panel. But I guess you mean the Fade function specific to a Cutaway. When you double-click on a Cutaway the Inspector opens. Here you can set the Cutaway Fade duration. But as you say, it only provides for both fade in and fade out as one operation - you can't set the fades individually (it's both or nothing).
    BUT, try the method outlined by Karsten Schluter above. It will give you the same effect and will enable you to fade either side of the Cutaway (or add other transitions).
    John

  • How can I make a "Keyboard Lock" while iTunes is playing?

    How can I make a "Keyboard Lock" while iTunes or other apps are playing? They should work/play on, screen should still be on, only keyboard is (maybe Password-) locked.
    Thanx in adv, tttimo

    Menu > Apple > System Preferences > Keyboard > Keyboard Shortcuts Application Shortcuts > + > Application: Browse to Pages > Menu Title: Footnote > Keyboard Shortcut: hit combination of keys > Add
    You will need to restart Pages but should then see it next to your Menu item.
    Peter

  • When I connect my ipod to my computer it opens my documents and won't show up in my itunes and I have unistalled then reinstalled itunes and reset my ipod twice and it stills does the same thing how can I make it so that it shows up in my itunes?

    When I connect my ipod to my computer it opens my documents and won't show up in my itunes and I have unistalled then reinstalled itunes and reset my ipod twice and it stills does the same thing how can I make it so that it shows up in my itunes?

    Try
    iOS: Device not recognized in iTunes for Windows
    I would start with              
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    or              
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    Before you reinstall the Apple software, also remove iCloud vi Control Panel Remove programs. The reinstall the Apple programs
    New cable and different USB port?
    Runs this and see if the results help with determine the cause
    iTunes for Windows: Device Sync Tests
    Try on another computer to help determine if computer or iPod problem

Maybe you are looking for