Height of the containers in split container

Hi, I'm trying to split the container into 3 containers i.e. cont1, cont2, cont3. code is as follows.
Could anyone please help me how to set the height for the containers cont1, cont2, cont3. Thanks in advance.
DATA: split_cont_ob   TYPE REF TO cl_gui_splitter_container, " Splitter Object
            cont1           TYPE REF TO cl_gui_container,          " Container Object
            cont2           TYPE REF TO cl_gui_container,          " Container Object
            cont3           TYPE REF TO cl_gui_container,          " Container Object
           cust_cont_ob        TYPE REF TO cl_gui_custom_container.
  IF cust_cont_ob IS INITIAL.
    CREATE OBJECT cust_cont_ob
      EXPORTING
        container_name              = 'CUST_CONT'
      EXCEPTIONS
        cntl_error                  = 1
        cntl_system_error           = 2
        create_error                = 3
        lifetime_error              = 4
        lifetime_dynpro_dynpro_link = 5
        OTHERS                      = 6.
    IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CREATE OBJECT split_cont_ob
      EXPORTING
        parent            = cust_cont_ob
        rows              = 3
        columns           = 1
      EXCEPTIONS
        cntl_error        = 1
        cntl_system_error = 2
        OTHERS            = 3.
    IF sy-subrc <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD split_cont_ob->get_container
      EXPORTING
        row       = 1
        column    = 1
      RECEIVING
        container = cont1.
    CALL METHOD split_cont_ob->get_container
      EXPORTING
        row       = 2
        column    = 1
      RECEIVING
        container = cont2.
    CALL METHOD split_cont_ob->get_container
      EXPORTING
        row       = 3
        column    = 1
      RECEIVING
        container = cont3.
ENDIF.

Sorry I was not precise enought. For height of particular container you should be using this
"first set type of splitter bar
    CALL METHOD SPLIT_CONT_OB->SET_ROW_SASH
      EXPORTING
        ID    = 1                                    "first conatiner (actually splitter bar)
        type  = cl_gui_splitter_container=>type_movable
        value = cl_gui_splitter_container=>false.
"now set its value in % of entire costum control (so here first container will occupy 80% of enitre custom control space).
    SPLIT_CONT_OB->set_row_height( id = 1 height = 80 ).
As for the second question with toolbar: I believe this is not possible. All buttons in SAP are of size directly used. So only the size needed for fitting icon + text will be used. There is no option to widen this.
Regards
Marcin

Similar Messages

  • How to fix the size of split container.

    Hi All,
    I have a requirement to display 5 alv report grid report .For this requirement i split the container into 5 rows and display the report sucessfully.
    Now i need to fix size of split container's acoording to number of rows comes in alv report.Could you please let me know
    how to achieve that.
    Regards,
    Mohit

    hi,
    Try this article..
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/50f1786c-a627-2e10-07b9-fefe548376ad
    Regards
    Rajashiva Ramalingam

  • Spry Accordion menu - How do you make tabs without content and make panel height fit the content?

    I have an Accordion Menu on my site and I would like to put a tab at the top that links to my homepage when clicked, instead of sliding open to show a content panel. I don't have any extra info to put in the content panel, so it would look kind of redundant to have it there.
    Also, each panel has a different amount of content, but they all default to the same height to fit the largest content. I want them to fit to the content of each panel. The only thing I've read said to set the height of the content panel to 100% in the CSS, but it didn't change anything.
    Thanks!
    Andrea
    http://www.andreamutsch.com

    You make it look so simple but it doesn't seem to be working for me...
    My first thought with getting rid of the tab content was to simply delete it, but when I do that I get a warning that 'The structure of the accordian appears to be damaged'. Then when I preview none of the tabs will open.
    This is what my accordian structure looks like with the tab content code deleted...
    <div id="Accordion1" tabindex="0">
          <div class="AccordionPanel">
            <div class="AccordionPanelTab">home</div>
            </div>
          <div class="AccordionPanel">
            <div class="AccordionPanelTab">graphic design</div>
            <div class="AccordionPanelContent">
              <p align="center">identity </p>
              <p align="center">print </p>
              <p align="center">packaging</p>
              <p align="center">web </p>
            </div>
          </div>
    <div class="AccordionPanel">
            <div class="AccordionPanelTab">photography</div>
            <div class="AccordionPanelContent">
              <p>traditional</p>
              <p>digital</p>
              <p>retouch</p>
            </div>
          </div>
          <div class="AccordionPanel">
            <div class="AccordionPanelTab">contact</div>
            <div class="AccordionPanelContent">
              <p>email me</p>
              <p>design quote</p>
              <p>purchase photography</p>
            </div>
          </div>
          <div class="AccordionPanel">
            <div class="AccordionPanelTab">resume</div>
            <div class="AccordionPanelContent">download resume (.pdf)</div>
          </div>
          <div class="AccordionPanel">
            <div class="AccordionPanelTab">design blog</div>
            <div class="AccordionPanelContent">2009</div>
          </div>
    Also, getting rid of the height in the CSS had no effect (I did this before I did the above)
    Below is my current CSS for the Panel Content
    .AccordionPanelContent {
        overflow: auto;
        margin: 0px;
        padding: 0px;
        font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
        font-size: large;
        background-color: #633408;
        font-weight: normal;
        word-spacing: normal;
        text-align: center;
    Also there is a note in the CSS that says this...
    * Anyone who styles an Accordion *MUST* specify a height on the Accordion Panel
    * Content container.
    I'm not sure how accurate that is since I don't have a height in there and it worked (although not how I wanted) but I just thought I would throw it in.

  • HT1473 When downloading a CD album, if it contains different artists, the album is split up into separate albums/icons. How do I get all songs into one album (just like the original CD)?

    When downloading a CD album, if it contains different artists, the album is split up into separate albums/icons. How do I get all songs into one album (just like the original CD)?

    Generally, in iTunes, all you need to do is fill in an appropriate Album Artist to keep things together. For older iPods each track from the same album should have the same artist, or be marked as a compilation where appropriate. For iOS devices you may need to go to Settings > Music > Group By Album Artist > On.
    For more details see my article on Grouping Tracks Into Albums, in particular the topic One album, too many covers.
    tt2

  • I have highlighted words in an .iba file. Now I need to increase the space before (and/or after) the paragraph it's contained in. If I increase the space after, the height of the highlighting increases also. Is there any way around this?

    I have highlighted words in an .iba file. Now I need to increase the space before (and/or after) the paragraph it's contained in. If I increase the space after, the height of the highlighting increases also. Is there any way around this?

    http://www.apple.com/feedback/kaywerty wrote:
    A rather long winded way of asking if anybody knows if it's possible to have multi-windows open
    It's not possible.
    Suggestions here -> Apple Product feedback

  • Getting a wrapper container div to adjust to the height of the content within it.

    Hey -
    I have a "wrapper" div tag set up and then I have a bunch of separate div boxes within that.
    The way I did it is all the div boxes within the wrapper are set to "absolute" position and then I basically put them all where I wanted them by defining the "top" and "left" property.
    What I'd like now is the "wrapper" div to adjust in height according the size of the div boxes with in it.
    How can I do this?
    Thanks....

    Height of a container needs to be determined by the content inside it.  If your site visitors increase text size in their browser, and you have explicit height values expressed in your CSS, your page could fall apart or become unusable.
    For better answers, we need to see your page.  Can you post a link?
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • Height of a Tile (or orther container) not changed after inserting nodes

    Hi,
    I am a javafx beginner and I'm struggeling with the size of the containers. Here is what I try to do:
    I am making a photo gallery in which an Album can contain subalbums and photos through which a user can scroll. The Album objects are stored in a Tile, the Photo objects in another Tile. These Tiles I want to display vertically in a VBox, which is in turn placed on a Clipview. Now my problem is: the height of the Tile is not changing when I insert Photos or Albums in the Tiles. And I need these heights (or that of the VBox) to do calculations for my scrollbar. When I print the bounds for the album Tile before inserting Album objects everything is 0, which is correct. But when I print the bounds after insertion of 10 Albums the height is given as the height of only 1 Album, even without hgap and vgap. The height of the VBox is also equal to this height of 1 node.
    What am I missing here? How can I get the correct height to use for my scrollbar calculations?
    I hope you can help me out, because it's hunting me for days now :-)
    Thanx,
    RedMary

    Well, that's one of the mysteries of JavaFX: the initialization order... :-)
    When you create the custom node, it is not yet in layout, so the tile isn't laid out either, and its dimensions aren't final.
    If I add a button to the scene to dump the data, you can see the final dimensions.
    I also tried a trick this week-end, to override doLayout to know when a node have been laid out. A quick test shown mixed results, but perhaps it can be a starting point.
    class Gallery extends CustomNode {
        var albumList = Tile {
            width: 1000
            vgap: 25
            hgap:25
            content: []
        var photoList = Tile {
            width: 1000
            vgap: 25
            hgap:25
            content: []
        var box = VBox {
            spacing: 50
            content: [albumList,photoList]
            override function doLayout(): Void
                super.doLayout();
                ShowData("After B layout");
        public override function create(): Node {
            ShowData("Before insertion:");
            for (i in [1..10]) {
                 var rect = Rectangle {
                     width: 100;
                     height: 100;
                     fill: Color.RED;
                 insert rect into albumList.content;
             for (i in [1..15]) {
                 var rect = Rectangle {
                     width: 100;
                     height: 100;
                     fill: Color.WHITE;
                 insert rect into photoList.content;
            ShowData("After insertion:");
            var group = Group {
                content:[box]
                override function doLayout(): Void
                    super.doLayout();
                    ShowData("After G layout");
            return(group)
        function ShowData(msg: String): Void {
            println("==> {msg}");
            println("albumList LayoutBounds:{albumList.layoutBounds}");
            println("albumList BoundsInLocal:{albumList.boundsInLocal}");
            println("albumList BoundsInParent:{albumList.boundsInParent}");
            println("box LayoutBounds:{box.layoutBounds}");
            println("box BoundsInLocal:{box.boundsInLocal}");
            println("box BoundsInParent:{box.boundsInParent}");
    Stage {
        title: "Application title"
        width: 1000
        height: 800
        var gallery = Gallery {}
        scene: Scene {
            width: 1000
            height: 800
            fill: Color.BLACK;
            content: [
                gallery,
                Button {
                    text: "D"
                    action: function (): Void {
                        gallery.ShowData("On button click");
    }

  • IFrame(child container) still visible after closing the title window(parent container)

    Hi All ,
    I have created a sample project using a link button which when clicked opens up an TitleWindow which has an iframe and a text area in a hbox
    When you execute the application ,
              Click the link button
              The Popup window opens up showing the title window with the close button
              Click the close button of the title window
              The Title window is removed and the iframe and the text area are not visible
    Do this a couple of times
    You can notice that the iframe is still visible even when the title window is closed
    Can someone explain me how this issue can be resolved and also explain me why the iframe(child container) is still visible when the title window(parent container) is not visible. 
    Main Application file
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
        width="100%" height="100%" creationPolicy="all"
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical" creationComplete="init()"
        xmlns:containers="containers.*">
       <mx:Script>
       <![CDATA[
           import mx.managers.PopUpManager;
           import containers.PopUpBrowser;
           public function doRequest():void
                    var requestPopup:PopUpBrowser = PopUpManager.createPopUp(this, PopUpBrowser) as PopUpBrowser;
                    PopUpManager.addPopUp(requestPopup,this);
                    requestPopup.x = 220;
                    requestPopup.y = 50;
       ]]>
       </mx:Script>
       <mx:Text fontSize="14" fontWeight="bold" text="Click the link button below to open the Title Window" />
       <mx:Spacer height="100"/>
       <mx:LinkButton label="Click me" fontSize="16" fontWeight="bold" click="doRequest()"/>
    </mx:Application>
    PopUpBrowser.mxml Component
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow
        xmlns:mx="http://www.adobe.com/2006/mxml"
        close="removeMe()"
        showCloseButton="true"
        styleName="myTitleWindowStyle"
        width="850" height="500"
        title="Klout User Profile"
        paddingTop="1" paddingBottom="1"
        paddingLeft="1" paddingRight="1"
        xmlns:generic="com.serendio.voom.components.generic.*"
        xmlns:flexiframe="http://code.google.com/p/flex-iframe/"
        horizontalScrollPolicy="off"
        verticalScrollPolicy="off" >
        <mx:Script>
            <![CDATA[
                import mx.managers.PopUpManager;
                public function removeMe():void
                    PopUpManager.removePopUp(this);
            ]]>
        </mx:Script>
        <mx:HBox width="100%" height="100%">
        <flexiframe:IFrame source="http://www.google.com" id="iFrame" width="50%" height="100%"/>
        <mx:TextArea text="Open and close the title window few times and watch the iframe remain visible even when the title window is closed"
             fontSize="14" width="50%" height="80%"/>
        </mx:HBox>
    </mx:TitleWindow>
    Thanks,
    Ajantha

    Hey,
    This is working fine for me with the current 4.5 Flex, Firefox 3.6.12, IE8. On what browser you are getting this error.
    Thanks,
    Jayagopal.

  • Background colour of splitting container

    is it possible to change the background colour of the splitting container?

    All that you can do for a splitter container can be seen in the class
    CL_GUI_SPLITTER_CONTAINER
    I dont think there is any provision for background color..
    There are other things that you can play with like height,width etc..
    Regards,
    Prashant

  • OOABAP - CL_GUI_TOOLBAR functions in a split container

    Hi, I have created one custom split container and split it to 2 rows.I'm adding push buttons in both rows(containers) using CREATE OBJECT toolbar_object & CALL METHOD toolbar_object->add_button
    Could any one please help me out with:
    (1) when I add push buttons in conainer, buttons are appearing without any gap. how do we have buttons with some space.
    (2) how do we have header/title to identify the corresponsing containers/rows as I have created one custom split container and split it to 2 rows.
    Thanks in advance.

    To achieve that you will have to split custom container into 4 parts (with cl_gui_splitter_container ). Now top row would be for heading, second for toolbar, next for heading, 4th for toolbar.
    In each heading you can place dynamic document to display your header/title
    DATA: r_dd_document TYPE REF TO cl_dd_document,   "dynamic document ref.variable
          r_custom_container TYPE REF TO cl_gui_custom_container.
    CALL SCREEN 900.
    MODULE pbo OUTPUT.
       "first your initial custom container
      CREATE OBJECT r_custom_container
        EXPORTING
          container_name    = 'CUSTOM_CONTROL'.
       "here you need to split cutom container in 4 parts
      "now create dd document
      CREATE OBJECT r_dd_document
        EXPORTING
           no_margins = 'X'.
      "add header text
      CALL METHOD r_dd_document->add_text
        EXPORTING
          text             = 'Some heading'
          sap_style        = cl_dd_area=>HEADING.
      "dispaly it in one of the containers
      CALL METHOD r_dd_document->display_document
        EXPORTING
          parent    = "here give reference to one of the containers you have
    ENDMODULE.
    Regards
    Marcin

  • Assign title to the containers created by CL_GUI_EASY_SPLITTER_CONTAINER

    Hi,
    I have a report showing 2 ALV lists within the same report.
    I have done the following:
    1. Create CL_GUI_CUSTOM_CONTAINER
    2. Create 2 containers using CL_GUI_EASY_SPLITTER_CONTAINER
    3. Using CL_SALV_TABLE displaying report in each of the containers.
    This is working fine but how do I set the titles in each splitted container?
    Thanks in advance.

    It is not possible to set the Title of the Splitter Container. But you can set the Title of the ALV.
        DATA: LO_DISPLAY TYPE REF TO CL_SALV_DISPLAY_SETTINGS.
        LO_DISPLAY = O_ALV1->GET_DISPLAY_SETTINGS( ).
    *   Title to ALV
        LO_DISPLAY->SET_LIST_HEADER( 'TEST' ).
    Regards,
    Naimesh Patel

  • MAC OS no maps in the containers

    Unfortunately for mac os no maps in the containers.
    This example works in WindowsXP OS but does not work on MAC
    OS
    quote:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    private function changeHandler(event:Event):void {
    image.source = event.target.selectedItem.nativePath;
    ]]>
    </mx:Script>
    <mx:HBox width="100%" height="100%">
    <mx:FileSystemTree width="50%" height="100%"
    change="changeHandler(event);"/>
    <mx:Image id="image" width="50%" height="100%"
    scaleContent="true" />
    </mx:HBox>
    </mx:WindowedApplication>
    Can somebody suggest what is the problem?

    Thank you very much! url works fine.

  • I created a Pages document inserting 2 columns using 1) Inspector 2) Layout 3) columns.  How do I decrease the height of the column.  Have tried to use cursor and drag down the top border, but that does not reset the top border.

    I created a Pages document inserting 2 columns using 1) Inspector 2) Layout 3) columns.  How do I decrease the height of the column.  Have tried to use the cursor and drag down the top border, but that does not reset/decrease the top border.

    Set your columns back to one for the moment. In layout mode, insert a Text box. Place it in the upper left corner of your document, and drag down and right to the size of the container for your two columns. Click inside the Text Box, and now bump up your columns to 2. Your two columns are now contained in this resizable Text Box.

  • Fit the image to window width, window height and  the window size

    hi all
    here we wrote the code for "fit the image to window width, window height and the window size". we are facing some problems in it. and all these operations have to perform even after zooming operations are done.if the below code doesnt satisfy kindly provide appropriate code .
    thanks .
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.io.File;
    import javax.swing.filechooser.FileFilter;
    import java.awt.geom.*;
    public class DP extends JFrame implements ActionListener,
                                               MouseListener,
                                               MouseMotionListener {
        private final int PEN_OP = 1;
        private final int CLEAR_OP = 2;
        private int radius;
        private int radius1;
        private int mousex = 0;
        private int mousey = 0;
        private int prevx = 0;
        private int prevy = 0;
        private boolean initialFreeHand = true;
        private boolean initialLine = true;
        private boolean initialEraser = true;
        private int Orx = 0;
        private int Ory = 0;
        private int OrWidth = 0;
        private int OrHeight = 0;
        private int drawX = 0;
        private int drawY = 0;
        private int polyX = 0;
        private int polyY = 0;
        private int eraserLength = 5;
        private int udefRedValue = 255;
        private int udefGreenValue = 255;
        private int udefBlueValue = 255;
        private int opStatus = PEN_OP;
        private int colorStatus = 1;
        private double zoomPercentage=10;
        private Color mainColor = new Color(0, 0, 0);
        private Color xorColor = new Color(255, 255, 255);
        private Color userDefinedColor =
            new Color(udefRedValue, udefGreenValue,udefBlueValue);
        private JButton openButton = new JButton("open");
        private JButton closeButton = new JButton("close");
         private JButton zoominButton = new JButton("ZoomIn");
         private JButton zoomoutButton = new JButton("ZoomOut");
         private JButton zoomto100Button = new JButton("ZoomTo100");
         private JButton fwwButton = new JButton("Fit window width");
         private JButton fwhButton = new JButton("Fit window height");
         private JButton fwButton = new JButton("Fit the window");
        private JButton clearButton = new JButton("Clear");
        private JTextField colorStatusBar = new JTextField(20);
        private JTextField opStatusBar = new JTextField(20);
        private JTextField mouseStatusBar = new JTextField(10);
        private JPanel controlPanel = new JPanel(new GridLayout(18, 1, 0, 0));
        JToolBar jToolbar = new JToolBar();
        private Container container;
        private JScrollBar horizantalSlide=new JScrollBar();
        public BufferedImage image;
        BufferedImage bgImage;
    //    public ImageIcon icon=null;
        JFileChooser fileChooser;
        DrawPanel drawPanel = new DrawPanel(bgImage,zoomPercentage);
        public DP() {
            super("WhiteBoard");
            fileChooser = new JFileChooser(".");
            container = getContentPane();
            container.setBackground(Color.white);
            container.setLayout(new BorderLayout());
            container.add(jToolbar,BorderLayout.NORTH);
            container.add(horizantalSlide);
            jToolbar.add(openButton);
            jToolbar.add(closeButton);
              jToolbar.add(zoominButton);
              jToolbar.add(zoomoutButton);
              jToolbar.add(zoomto100Button);
              jToolbar.add(fwwButton);
              jToolbar.add(fwhButton);
              jToolbar.add(fwButton);
            jToolbar.add(clearButton);
            colorStatusBar.setEditable(false);
            opStatusBar.setEditable(false);
            mouseStatusBar.setEditable(false);
            controlPanel.setBackground(Color.white);
            drawPanel.setBackground(Color.white);
            container.add(controlPanel, "West");
            container.add(drawPanel, "Center");
            openButton.addActionListener(this);
            closeButton.addActionListener(this);
              zoominButton.addActionListener(this);
              zoomoutButton.addActionListener(this);
              zoomto100Button.addActionListener(this);
              fwwButton.addActionListener(this);
              fwhButton.addActionListener(this);
              fwButton.addActionListener(this);
            clearButton.addActionListener(this);
            drawPanel.addMouseMotionListener(this);
            drawPanel.addMouseListener(this);
            addMouseListener(this);
            addMouseMotionListener(this);
            opStatusBar.setText("FreeHand");
            colorStatusBar.setText("Black");
        public void actionPerformed(ActionEvent e) {
            if(e.getActionCommand().equals("open"))
                showDialog();
            if(e.getActionCommand().equals("close"))
                closeDialog();
              if(e.getActionCommand().equals("ZoomIn"))
                   drawPanel.zoom(1);
              if(e.getActionCommand().equals("ZoomOut"))
                   drawPanel.zoom(-1);
              if(e.getActionCommand().equals("ZoomTo100"))
                   drawPanel.zoom(+10);
              if(e.getActionCommand().equals("Fit window width"))
                   drawPanel.fitwindowwidth();
              if(e.getActionCommand().equals("Fit window height"))
                   drawPanel.fitwindowheight();
              if(e.getActionCommand().equals("Fit the window"))
                   drawPanel.fitthewindow();
            if (e.getActionCommand() == "Clear")
                opStatus = CLEAR_OP;
            switch (opStatus) {
                case CLEAR_OP:
                    clearPanel();
        private void showDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    bgImage = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("IO error: " + e.getMessage());
                clearPanel();
        private void closeDialog() {
            drawPanel.setVisible(false);
            drawPanel.repaint();
        public void clearPanel() {
            opStatusBar.setText("Clear");
            Graphics g = image.getGraphics();
            g.setColor(drawPanel.getBackground());
            g.fillRect(0, 0, drawPanel.getBounds().width, drawPanel.getBounds().height);
            if(bgImage != null)
                g.drawImage(bgImage, 0, 0, this);
            g.dispose();
            drawPanel.repaint();
        public boolean mouseHasMoved(MouseEvent e) {
            return (mousex != e.getX() || mousey != e.getY());
        public void setActualBoundry() {
            if (mousex < Orx || mousey < Ory) {
                if (mousex < Orx) {
                    OrWidth = Orx - mousex;
                    drawX = Orx - OrWidth;
                } else {
                    drawX = Orx;
                    OrWidth = mousex - Orx;
                if (mousey < Ory) {
                    OrHeight = Ory - mousey;
                    drawY = Ory - OrHeight;
                } else {
                    drawY = Ory;
                    OrHeight = mousey - Ory;
            } else {
                drawX = Orx;
                drawY = Ory;
                OrWidth = mousex - Orx;
                OrHeight = mousey - Ory;
        public void setGraphicalDefaults(MouseEvent e) {
            mousex = e.getX();
            mousey = e.getY();
            prevx = e.getX();
            prevy = e.getY();
            Orx = e.getX();
            Ory = e.getY();
            drawX = e.getX();
            drawY = e.getY();
            OrWidth = 0;
            OrHeight = 0;
        public void mouseDragged(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseReleased(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseEntered(MouseEvent e) {
            updateMouseCoordinates(e);
        public void updateMouseCoordinates(MouseEvent e) {
            String xCoor = "";
            String yCoor = "";
            if (e.getX() < 0)
                xCoor = "0";
            else {
                xCoor = String.valueOf(e.getX());
            if (e.getY() < 0)
                xCoor = "0";
            else {
                yCoor = String.valueOf(e.getY());
            mouseStatusBar.setText("x:" + xCoor + " y:" + yCoor);
        public void mouseClicked(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseExited(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseMoved(MouseEvent e) { updateMouseCoordinates(e); }
        public void mousePressed(MouseEvent e) { updateMouseCoordinates(e); }
        public static void main(String[] args) {
            DP wb = new DP();
            wb.setDefaultCloseOperation(EXIT_ON_CLOSE);
            wb.setSize(1024,740);
            wb.setVisible(true);
        private class DrawPanel extends JPanel {
            private double m_zoom = 1.0;
            private double m_zoomPercentage;
            private BufferedImage m_image;
            double theta = 0;
            double thetaInc = Math.PI/2;
            public DrawPanel(BufferedImage imageb,double zoomPercentage) {
                m_image = imageb;
                m_zoomPercentage = zoomPercentage / 100;
            protected void paintComponent(Graphics g) {
                Graphics2D g2d=(Graphics2D)g;
                if(image == null)
                    initImage();
                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                     RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                double x = (1.0 - m_zoom)*getWidth()/2.0;
                double y = (1.0 - m_zoom)*getHeight()/2.0;
                AffineTransform at = AffineTransform.getTranslateInstance(x, y);
                at.rotate(theta,m_zoom*getWidth()/2,m_zoom*getHeight()/2);
                at.scale(m_zoom, m_zoom);
                g2d.drawRenderedImage(image, at);
      public void zoom(int inc) {
            m_zoom += inc * m_zoomPercentage;
            repaint();
              public void fitwindowwidth()
                int w1=drawPanel.getWidth();
                int h1=drawPanel.getHeight();
                BufferedImage image2=image.getScaledInstance(w1,h1,Image.SCALE_DEFAULT);
                drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
               drawPanel.repaint();
              public void fitwindowheight()
           BufferedImage image2=image.getScaledInstance(500,680,1); 
           drawPanel.setImage(iicon);
           drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
           drawPanel.repaint();
              public void fitthewindow()
           BufferedImage image2=image.getScaledInstance(1000,680,1);
           drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
           drawPanel.repaint();
            private void initImage() {
                int w = getWidth();
                int h = getHeight();
                image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                g2.setPaint(getBackground());
                g2.fillRect(0,0,w,h);
                g2.dispose();
    }

    thank you for giving reply.
    your code is very helpful to us.but i couldn't integrate it in my code.here's my code.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.io.File;
    import javax.swing.filechooser.FileFilter;
    import java.awt.geom.*;
    public class IS extends JFrame implements ActionListener,
                                               MouseListener,
                                               MouseMotionListener {
        private final int PEN_OP = 1;
        private final int CLEAR_OP = 2;
         private     final int DISTORT = 3;
        private final int SCALE   = 4;
        private final int FIT     = 5;
        private final int FILL    = 6;
        int scaleMode = SCALE;
        private int radius;
        private int radius1;
        private int mousex = 0;
        private int mousey = 0;
        private int prevx = 0;
        private int prevy = 0;
        private boolean initialFreeHand = true;
        private boolean initialLine = true;
        private boolean initialEraser = true;
        private int Orx = 0;
        private int Ory = 0;
        private int OrWidth = 0;
        private int OrHeight = 0;
        private int drawX = 0;
        private int drawY = 0;
        private int polyX = 0;
        private int polyY = 0;
        private int eraserLength = 5;
        private int udefRedValue = 255;
        private int udefGreenValue = 255;
        private int udefBlueValue = 255;
        private int opStatus = PEN_OP;
        private int colorStatus = 1;
        private double zoomPercentage=10;
        private Color mainColor = new Color(0, 0, 0);
        private Color xorColor = new Color(255, 255, 255);
        private Color userDefinedColor =
            new Color(udefRedValue, udefGreenValue,udefBlueValue);
        private JButton openButton = new JButton("open");
        private JButton closeButton = new JButton("close");
         private JButton zoominButton = new JButton("ZoomIn");
         private JButton zoomoutButton = new JButton("ZoomOut");
         private JButton zoomto100Button = new JButton("ZoomTo100");
         private JButton fwwButton = new JButton("Fit window width");
         private JButton fwhButton = new JButton("Fit window height");
         private JButton fwButton = new JButton("Fit the window");
        private JButton clearButton = new JButton("Clear");
        private JTextField colorStatusBar = new JTextField(20);
        private JTextField opStatusBar = new JTextField(20);
        private JTextField mouseStatusBar = new JTextField(10);
        private JPanel controlPanel = new JPanel(new GridLayout(18, 1, 0, 0));
        JToolBar jToolbar = new JToolBar();
        private Container container;
        private JScrollBar horizantalSlide=new JScrollBar();
        public BufferedImage image;
        BufferedImage bgImage;
    //    public ImageIcon icon=null;
        JFileChooser fileChooser;
        DrawPanel drawPanel = new DrawPanel(bgImage,zoomPercentage);
        public IS() {
            super("WhiteBoard");
            fileChooser = new JFileChooser(".");
            container = getContentPane();
            container.setBackground(Color.white);
            container.setLayout(new BorderLayout());
            container.add(jToolbar,BorderLayout.NORTH);
            container.add(horizantalSlide);
            jToolbar.add(openButton);
            jToolbar.add(closeButton);
              jToolbar.add(zoominButton);
              jToolbar.add(zoomoutButton);
              jToolbar.add(zoomto100Button);
              jToolbar.add(fwwButton);
              jToolbar.add(fwhButton);
              jToolbar.add(fwButton);
            jToolbar.add(clearButton);
            colorStatusBar.setEditable(false);
            opStatusBar.setEditable(false);
            mouseStatusBar.setEditable(false);
            controlPanel.setBackground(Color.white);
            drawPanel.setBackground(Color.white);
            container.add(controlPanel, "West");
            container.add(drawPanel, "Center");
            openButton.addActionListener(this);
            closeButton.addActionListener(this);
              zoominButton.addActionListener(this);
              zoomoutButton.addActionListener(this);
              zoomto100Button.addActionListener(this);
              fwwButton.addActionListener(this);
              fwhButton.addActionListener(this);
              fwButton.addActionListener(this);
            clearButton.addActionListener(this);
            drawPanel.addMouseMotionListener(this);
            drawPanel.addMouseListener(this);
            addMouseListener(this);
            addMouseMotionListener(this);
            opStatusBar.setText("FreeHand");
            colorStatusBar.setText("Black");
        public void actionPerformed(ActionEvent e) {
            if(e.getActionCommand().equals("open"))
                showDialog();
            if(e.getActionCommand().equals("close"))
                closeDialog();
              if(e.getActionCommand().equals("ZoomIn"))
                   drawPanel.zoom(1);
              if(e.getActionCommand().equals("ZoomOut"))
                   drawPanel.zoom(-1);
              if(e.getActionCommand().equals("ZoomTo100"))
                   drawPanel.zoom(+10);
              if(e.getActionCommand().equals("Fit window width"))
                   //drawPanel.fitwindowwidth();
              drawPanel.scaleImage(0,0,0,0);
              if(e.getActionCommand().equals("Fit window height"))
              drawPanel.scaleImage(0,0,0,0);
              if(e.getActionCommand().equals("Fit the window"))
              drawPanel.scaleImage(0,0,0,0);
            if (e.getActionCommand() == "Clear")
                opStatus = CLEAR_OP;
            switch (opStatus) {
                case CLEAR_OP:
                    clearPanel();
        private void showDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    bgImage = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("IO error: " + e.getMessage());
                clearPanel();
        private void closeDialog() {
            drawPanel.setVisible(false);
            drawPanel.repaint();
        public void clearPanel() {
            opStatusBar.setText("Clear");
              int w = image.getWidth();
            int h = image.getHeight();
            Graphics g = image.getGraphics();
            g.setColor(drawPanel.getBackground());
            g.fillRect(0, 0, w, h);
            if(bgImage != null) {
                int x = (w - bgImage.getWidth())/2;
                int y = (h - bgImage.getHeight())/2;
                g.drawImage(bgImage, x, y, this);
            g.dispose();
            drawPanel.repaint();
        public boolean mouseHasMoved(MouseEvent e) {
            return (mousex != e.getX() || mousey != e.getY());
        public void setActualBoundry() {
            if (mousex < Orx || mousey < Ory) {
                if (mousex < Orx) {
                    OrWidth = Orx - mousex;
                    drawX = Orx - OrWidth;
                } else {
                    drawX = Orx;
                    OrWidth = mousex - Orx;
                if (mousey < Ory) {
                    OrHeight = Ory - mousey;
                    drawY = Ory - OrHeight;
                } else {
                    drawY = Ory;
                    OrHeight = mousey - Ory;
            } else {
                drawX = Orx;
                drawY = Ory;
                OrWidth = mousex - Orx;
                OrHeight = mousey - Ory;
        public void setGraphicalDefaults(MouseEvent e) {
            mousex = e.getX();
            mousey = e.getY();
            prevx = e.getX();
            prevy = e.getY();
            Orx = e.getX();
            Ory = e.getY();
            drawX = e.getX();
            drawY = e.getY();
            OrWidth = 0;
            OrHeight = 0;
        public void mouseDragged(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {
        public void mouseReleased(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseEntered(MouseEvent e) {
            updateMouseCoordinates(e);
        public void updateMouseCoordinates(MouseEvent e) {
            String xCoor = "";
            String yCoor = "";
            if (e.getX() < 0)
                xCoor = "0";
            else {
                xCoor = String.valueOf(e.getX());
            if (e.getY() < 0)
                xCoor = "0";
            else {
                yCoor = String.valueOf(e.getY());
            mouseStatusBar.setText("x:" + xCoor + " y:" + yCoor);
        public void mouseClicked(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseExited(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseMoved(MouseEvent e) { updateMouseCoordinates(e); }
        public void mousePressed(MouseEvent e) { updateMouseCoordinates(e); }
        public static void main(String[] args) {
            IS wb = new IS();
            wb.setDefaultCloseOperation(EXIT_ON_CLOSE);
            wb.setSize(1024,740);
            wb.setVisible(true);
        private class DrawPanel extends JPanel {
            private double m_zoom = 1.0;
            private double m_zoomPercentage;
            private BufferedImage m_image;
            double theta = 0;
            double thetaInc = Math.PI/2;
            public DrawPanel(BufferedImage imageb,double zoomPercentage) {
                m_image = imageb;
                m_zoomPercentage = zoomPercentage / 100;
            protected void paintComponent(Graphics g) {
                   super.paintComponent(g);
                Graphics2D g2d=(Graphics2D)g;
                if(image == null)
                    initImage();
                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                     RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                              int w = getWidth();
                    int h = getHeight();
                  int iw = image.getWidth();
                  int ih = image.getHeight();
                  if(scaleMode == SCALE) {
                double x = (w - m_zoom*iw)/2;
                double y = (h - m_zoom*ih)/2;
                AffineTransform at = AffineTransform.getTranslateInstance(x, y);
                at.rotate(theta,m_zoom*getWidth()/2,m_zoom*getHeight()/2);
                at.scale(m_zoom, m_zoom);
                g2d.drawRenderedImage(image, at);
                   else {
                scaleImage(w, h, iw, ih);
              private void scaleImage( int w, int h, int iw, int ih) {
                             Graphics2D g2d = image.createGraphics();
            double xScale = (double)w/iw;
            double yScale = (double)h/ih;
            AffineTransform at = new AffineTransform();
            if(scaleMode == DISTORT) {
                double x = (w - xScale*iw)/2;
                double y = (h - yScale*ih)/2;
                at.setToTranslation(x, y);
                at.scale(xScale, yScale);
            } else {
                double scale = (scaleMode == FIT) ? Math.min(xScale, yScale)
                                                  : Math.max(xScale, yScale);
                double x = (w - scale*iw)/2;
                double y = (h - scale*ih)/2;
                at.setToTranslation(x, y);
                at.scale(scale, scale);
            g2d.drawRenderedImage(image, at);
      public void zoom(int inc) {
            m_zoom += inc * m_zoomPercentage;
            repaint();
            private void initImage() {
                int w = getWidth();
                int h = getHeight();
                image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                g2.setPaint(getBackground());
                g2.fillRect(0,0,w,h);
                g2.dispose();
    }

  • Who to get the height of the text in a Text Layout?

    Hey, I'm using the text layout component offered by adobe labs. I read the documentation and now capable of doing almost all what I need. I just have a small problem. Lets say I have a text layout object on my stage containing some text. How can I know the height of the text or the number of lines in it ???
    I found their is a porperty: "contentHeight"  and a method "calculateHeight()" but they are in another class of the libraries that comes with the text layout component. I don't know how to reach them. Please help and write me the lines of code that do this job.
    Thanks

    Well I was going to suggest that you post in the TLF forums, http://forums.adobe.com/community/labs/textlayout.
    But you seem to have found those. So instead I will suggest that you don't cross-post.
    Really if anybody could answer that it would be the folks there. I know there isn't a lot of traffic in those forums, but that is because the TLF is really insanely complicated and it is still beta. But it looks like most questions there do get some kind of answer....

Maybe you are looking for

  • FI-AR drilldown report

    Hello, I use the drilldown report to display the due date analysis for open Item for the customer. But I see that only the amount in Local currency (field name DMSHB) is available. In our system, in FI, we have activated the parallel currency (group

  • Black-screen when finalizing Windows 7 install and a few other things

    hi! ill get right to it.. i recently decided to install Windows 7 on my iMac due to the fact that i want more flexibility when it comes to gaming. i made a partition using Boot Camp, then rebooted with the Windows 7 cd. after a reboot or two the inst

  • Can't install Mavericks from OSX 10.7.5

    I've had many attempts at trying to install Mavericks from OSX 10.7.5 but when the download is complete & I try to do the install I get a message saying that the download could not be verified or was corrupted...

  • ****FIX **** update to 7.0 - Album Art problem- Disable/ReEnable failed

    I have a 30gb videopod and updated to version 7. I too was experiencing problems with some tracks not showing recently added album art. I tried disabling and re-enabling album art on both my powerbook and xp computer and which lead to no album art wa

  • Window Vista on my MSI

        Thinking about playing with Vista don't really know why except Just to look , Missing lots of Software and a few Harddrive Drivers.. Ok I was trying to install Vista on one of my 2 SATA promise controller drives, they are set up as Storage, Not r