Using null Layout - Problems

Hullo - I've written a little app that, because of the nature of what it does, prettymuch requires the use of null layout. It works well enough, but there are a few points where it does strange things that I don't understand. I haven't been able to find any good docs anywhere for how exactly layout/rendering works. The Swing tutorial, for example, almost completely ignores the topic.
Basically, I set the layout to null, add my components, use setBounds...but then nothing happens. In order for anything to be visible, I have to call pack() before I call show(). What is pack? What does it do? How can Sun's null layout examples work even though most of them don't use it?
Second, if I create JFrame of a certain size, and add a component that goes off the bottom of the JFrame (on purpose), then expand the size of the JFrame to reveal the bottom part of that component, it doesn't paint - there's just a grey area. No amount of repaint() pack() or anything will cause it to show. The only way I've found to do it is to make the JFrame larger to begin with, add the component so that it's visible, then resize to the smaller size, which is kind of ugly and clunky.
I basically do not understand why Swing is doing the things it does; why it paints sometimes and not other times, where it paints, when it paints, where it shows objects, how it packs them, etc. I would be very grateful if someone could englighten me!

Hullo - I've written a little app that, because of the
nature of what it does, prettymuch requires the use of
null layout. It works well enough, but there are a
few points where it does strange things that I don't
understand. I haven't been able to find any good docs
anywhere for how exactly layout/rendering works. The
Swing tutorial, for example, almost completely ignores
the topic.
Basically, I set the layout to null, add my
components, use setBounds...but then nothing happens.
In order for anything to be visible, I have to call
pack() before I call show(). What is pack? What
does it do? How can Sun's null layout examples work
even though most of them don't use it?
Second, if I create JFrame of a certain size, and add
a component that goes off the bottom of the JFrame (on
purpose), then expand the size of the JFrame to reveal
the bottom part of that component, it doesn't paint -
there's just a grey area. No amount of repaint()
pack() or anything will cause it to show. The only
way I've found to do it is to make the JFrame larger
to begin with, add the component so that it's visible,
then resize to the smaller size, which is kind of ugly
and clunky.
I basically do not understand why Swing is doing the
things it does; why it paints sometimes and not other
times, where it paints, when it paints, where it shows
objects, how it packs them, etc. I would be very
grateful if someone could englighten me!Okay, I think you should call setVisible(true); instead of pack then show. Pack basically organizes the components so they take up the least amount of room, and then it shrinks the frame to as small as it will go without hiding any components. It think if you call revalidate() instead of repaint(), should solve your problem.
The other thing to do, is (hehe) make your own components

Similar Messages

  • Putting a panel using null layout in in a JScrollPane

    Hi,
    I'm trying to create a form for the screen which looks exactly like its equivalent on paper. The form has a grid of cells that can be typed into.
    My approach so far has been to use a JTextPane for each cell and use absolute positioning to put these onto a JPanel with a null layout.
    This has worked well so far, but the JPanel is taller than the screen so I want to put it inside a JScrollPane.
    However the scrollbars don't show up.
    Can someone point out what I need to implement to be able to scroll my null layout JPanel in a JScrollPane.
    Thanks.

    That was nice and simple. The Duke's are yours.
    One problem leads to another unfortunately.
    I want the form to be centered so I put it in another JPanel with BorderLayout then put that in the JScrollPane. Unfortunately it is not centred.
    JPanel nullLayoutPanel = new JPanel();
    nullLayoutPanel.setLayout(null);
    // layout components on panel
    JPanel panelToKeepFormCentered= new JPanel(new BorderLayout());
    panelToKeepFormCentered.add(nullLayoutPanel, BorderLayout.CENTER);
    JFrame frame = new JFrame();
    frame.getContentPane().add(new JScrollPane(panelToKeepFormCentered));Hope it is clear what I'm trying to achieve.
    When the JFrame is smaller than the form (the nullLayoutPanel), scrollbars should show (they do now thanks to Noah).
    When the JFrame is bigger than the form, the form's JPanel should be centred in the JFrame with blank space around.
    Thanks.

  • Layout problem in Different Resolutions

    Hi All,
    I have a application which i have designed using null layouts and the resolution i have used is 1024x768. Now when i open the same application in 800x600 resolution some of the components placed at the bottom of the application are not seen. To resolve this issue i designed using GridBagLayout but still some of the components were not seen..Can anyone help me on how to resolve this issue..
    Thanks in advance
    Arpana

    Ya the size of the container was changed but our application is such that
    use of scrollpane is not recommended..Hence the problem..I have checked some softwares
    designed in java on different resolutions and amazingly all the components get repositioned
    according to the resolutions..But am yet to find out how it was achieved..

  • Using CardLayout and Null Layout

    I used search on the forums and found one person that asked the exact question I'm needing answered. But, he didn't get any responses either.
    I have a JFrame(myJFrame) which has a JPanel(myJpanel). myJpanel uses a CardLayout. I then have another class that extends JPanel(TestJpanel). TestJpanel uses a null layout. I am not able to get the TestJpanel to show correctly with the show(). method. However, if I change the layout of TestJpanel to anything else, presto it works. Has anyone uses null panels as the panels for a cardlayout panel?

    if you do setLayout(null) the component will leave all layout up to you. You can then use setSize(), setLocation(), and setBounds() on all children to position them however you'd like

  • Please help me out with problems i am facing using Grid Layout

    i can't figure out what's wrong !!
    But the following codw doesn't make a grid of 5 x 4 rather it makes a grid of 5x2
    same thing is happening when i am using a grid in my other applications... the no. of columns are not correctly executed..
    import javax.swing.*;
    import java.awt.*;
    public class GridDemo extends JFrame
        public GridDemo() {
        JButton b1 = new JButton("b1");
        JButton b2 = new JButton("b2");
        JButton b3 = new JButton("b3");
        JButton b4 = new JButton("b4");
        JButton b5 = new JButton("b5");
        JButton b6 = new JButton("b6");
        JButton b7 = new JButton("b7");
        JButton b8 = new JButton("b8");
        JButton b9 = new JButton("b9");
        JPanel f = new JPanel();
        f.setLayout(new GridLayout(5, 4));
        f.add(b1);
        f.add(b2);
        f.add(b3);
        f.add(b4);
        f.add(b5);
        f.add(b6);
        f.add(b7);
        f.add(b8);
        f.add(b9);
        JFrame f1 = new JFrame();
        f1.add(f);
        f1.setVisible(true);
        f1.setSize(400, 400);
        f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        public static void main(String s[])
        new GridDemo();
    }

    If you want the simplest experience out of layouts, you can try the custom layout I made. It uses the versatility of SpringLayout, but can actually be understood by humans. It has easily been my favorite creation b/c it has made my life SO much easier.
    Here is the code:
    import javax.swing.SpringLayout;
    import java.awt.Container;
    import java.awt.Component;
    public class CoordinateLayout extends SpringLayout
         //Container Variable
         Container cont;
         //Constructor
        public CoordinateLayout(Container ct)
             //Extend SpringLayout
             super();
             //Set Layout to Container
             ct.setLayout(this);
             //Initialize Container Variable
             cont = ct;
        //Method to Add Components -- (0,0) is top left of container
        public void addComponent(Component comp, int x, int y)
             //Adds Component to Container
             cont.add(comp);
             //Set both x and y SpringLayout contraints
             super.putConstraint(SpringLayout.WEST, comp, x, SpringLayout.WEST, cont);
              super.putConstraint(SpringLayout.NORTH, comp, y, SpringLayout.NORTH, cont);
    }And here is a basic program that just creates a frame and uses my layout to place the items. If you have any questions, feel free to ask.
    import javax.swing.*;
    import java.awt.*;
    public class CoordinateLayoutTest
        public static void main(String[] args)
             //Create Frame and Panel
             JFrame mainFrame = new JFrame("TEST");
             JPanel first = new JPanel();
             //Create Layout and send it the Panel
             CoordinateLayout layout = new CoordinateLayout(first);
             //Create components
             JLabel l1 = new JLabel("First Name:");
             JTextField b1 = new JTextField(10);
              JLabel l2 = new JLabel("Last Name:");
              JTextField b2 = new JTextField(10);
              JLabel l3 = new JLabel("Home City:");
              JTextField b3 = new JTextField(10);
              JLabel l4 = new JLabel("Home State:");
              JTextField b4 = new JTextField(10);
              JLabel l5 = new JLabel("Account Number:");
              JTextField b5 = new JTextField(10);
              //Add components
              layout.addComponent(l1,5,5);
              layout.addComponent(b1,105,5);
              layout.addComponent(l2,5,35);
              layout.addComponent(b2,105,35);
              layout.addComponent(l3,5,65);
              layout.addComponent(b3,105,65);
              layout.addComponent(l4,5,95);
              layout.addComponent(b4,105,95);
              layout.addComponent(l5,5,125);
              layout.addComponent(b5,105,125);
              //Simplify adding components by creating JLabels when you use them
             JTextField b1 = new JTextField(10);
              JTextField b2 = new JTextField(10);
              JTextField b3 = new JTextField(10);
              JTextField b4 = new JTextField(10);
              JTextField b5 = new JTextField(10);
              layout.addComponent(new JLabel("First Name:"),5,5);
              layout.addComponent(b1,105,5);
              layout.addComponent(new JLabel("Last Name:"),5,35);
              layout.addComponent(b2,105,35);
              layout.addComponent(new JLabel("Home City:"),5,65);
              layout.addComponent(b3,105,65);
              layout.addComponent(new JLabel("Home State:"),5,95);
              layout.addComponent(b4,105,95);
              layout.addComponent(new JLabel("Account Number:"),5,125);
              layout.addComponent(b5,105,125);
             //Finish creating Frame
             mainFrame.setSize(300,300);
             mainFrame.setContentPane(first);
             mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             mainFrame.setVisible(true);
    }

  • Using null value of item

    Hi All,
    I use this part-of-code in pl/sql statement in a 'where' clause in order to filter records to those that took place between some hours range:
    ..... and to_char(STARTDATE,'HH24:MI:SS') between NVL(:P3_HOURS_FROM,'00:00:00') and NVL(:P3_HOURS_TO,'23:59:59')
    P3_HOURS_FROM & P3_HOURS_TO are combo box items with LOV (0:00,0:30,1:00 ....etc that returns 00:00:00,00:30:00,1:00:00 respectively). I use a null value which is displayed as '--:--'.
    when i choose some hour range the rsults are correct. the problem is when i choose null values. there is no results to the report, probably (i guess) because it somehow translate the (null) time value to the same value (and it's obvious that between same time values there isn't any result).
    so i guess i use 'null' value in an inappropriate way.
    Can u tell me what do i do wrong???

    Are you sure you are returning NULL and just displaying '--:--' in your LOV?
    If the state of your LOV is becoming '--:--' then this does not equal null in PL/SQL land.
    I presume you are also submitting after changing your LOVs?
    You can check the state of your items by clicking the session state in the developers toolbar at the bottom. See what your items are being set and report back!
    Ben

  • Using null for parameterized "newInstance(Object [])" method in Object[].

    I have a really serious problem. I am creating instances of specific classes by using reflection techniques. I am reading a flat file, finding class from its name and creating it by using its parameterized constructor. Example:
    line 1: Dummy("A",Dummy2("B"),12,,"C");
    I create an instance of Dummy with parameters "A", an instance of Dummy2 object with value "B", 12 (I use here Integer as wrapper), null (There is no wrapper for null :( ) and "C".
    I find constructor by using findConstructors() and looking their parameter counts, creating an object array with given values and calling:
    constructorIFoundBefore.newInstance(objectArrayIPrepared);
    But!!!
    Because I use null directly, I got this message:
    java.lang.IllegalArgumentException: argument type mismatch
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at reader.parser.ObjectCreator.createObjectFromObjectItem(ObjectCreator.java:192)
         at reader.parser.ObjectCreator.createObjectFromParseItem(ObjectCreator.java:112)
         at reader.parser.ObjectCreator.createObject(ObjectCreator.java:78)
         at reader.analyzer.FileAnalyzer.analyzeAndCreateObjects(FileAnalyzer.java:95)
         at reader.ReverseReader.main(ReverseReader.java:43)
    I will be very glad if you help me.
    Thanks a lot!
    Gokcer

    I said something wrong. Sorry. While invoking a method (or a constructor) we need an object array which are equivalent to parameters. For example to call a method or constructor for class A;
    class A {
    int age;
    String name;
    public A(int age, String name){
    this.age = age;
    this.name = name;
    public set(int age, String name){
    this.age = age;
    this.name = name;
    we use in any place
    A a1 = new A(12,"Gokcer");
    A a2 = new A(15,null);
    To achieve this by using reflection techniques, we must find constructor with two parameters of class A. At this point "BetterMethodFinder" will give great help.
    After finding right constructor, we must create an object array to tell the constructor parameters (age and name). At this point we need an object array which stores our parameters. Code must be like this.
    Object []params = new Object[2]; // we have two parameters.
    params[0] = new Integer(12); // we can't use params[0]=12
    // because 12 is not an object. (It is a
    // primitive type)
    params[1] = "Gokcer";
    Now create the new object.
    A a1;
    a1 = constructorWeFound.newInstance(params);
    While creating param[], we could also use:
    Object []params = new Object[2] {new Integer(12),"Gokcer"};
    While creating a2, we can use "null" directly for second parameter.
    params = new Object[2] = {new Integer(15), null};
    or
    Object []params = new Object[2];
    params[0] = new Integer(15);params[1] = null;
    Thanks again everyone who replied me.
    My sincerely...

  • Difference between null layout and absolutelayout

    hello
    I would like to know the difference between the null layout and the absolutelayout
    thank you in advance

    http://www.google.com/search?q=absolutelayout
    Next time, please use the search yourself.Do I have to consider this as answer Yes.
    notice that I asked for the difference between both
    of the layout and not about
    absolutelayout only Third link, advertised by
    "I think AbsoluteLayout does more than just setting Layout to null. AbsoluteLayout may even accomodate for changes in font sizes etc. ..."
    already should give you something to think about.
    Furthermore, the search shows that there are several different classes named AbsoluteLayout (ADF, SWT, BUI, samskivert...), and you didn't specify which one you're talking about.
    Still think this wasn't an answer?
    I guess I should stop assuming that you have a brain of your own.

  • How do I use different Layouts?

    I am trying to make a program that runs in a window like this:
    http://www.exyt-web.com/Window.gif
    The problem I'm having is with the layout.
    How do I have more than one layout ?
    For example - as you can see in the image (hyperlink above) I wish to have a border layout with a JFrame at the North position and then in the South position I want to have buttons laid out in a FlowLayout.
    Also with my radio buttons I want these in a GridLayout(3, 0) layout.
    I made up some example code to test using different layouts - but it seems one layout always overrides the other...
    import java.awt.*;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    public class LayoutTest extends JFrame
        public LayoutTest()
            setTitle("Hello World");
            Container contents = getContentPane();
            Container contents2 = getContentPane();
            contents.setLayout(new FlowLayout());
            contents.add(new JLabel("<FILTER [Type a th|    ]>"));
            contents.add(contents2);
            contents.add(new JLabel("< Filter Button >"));
            contents.add(new JLabel("<  Add Button   >"));
            contents2.setLayout(new GridLayout());
            contents2.add(new JLabel("< Button 1 >"));
            contents2.add(new JLabel("< Button 2 >"));
            contents2.add(new JLabel("< Button 3 >"));
            contents2.add(new JLabel("< Button 4 >"));
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            pack();
        } // HelloWorld
        public static void main(String [] args)
            LayoutTest theLayoutTest = new LayoutTest();
            theLayoutTest.show();
        } // main
    } // class HelloWorldI know this obviously doesn't work but I hoped it would show what I was trying to do.
    I also tried creating a new 'contents2' and then adding it into 'contents'
    e.g. contents.add(contents2); My current code for the window I'm trying to create so far is:
    import java.awt.*;
    import javax.swing.*;
    public class Menus extends JFrame
        public static void Menus()
            // Creates a new JFrame, with the title specified in quotation marks.
            JFrame frame = new JFrame("Film Database");
            // Sets the default close operation of the frame.
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            // Creates a new menu bar for the frame.
            JMenuBar menuBar = new JMenuBar();
            // Creates a new menu for the menu bar.
            JMenu menu = new JMenu("File");
            addFrameContents(frame, menuBar, menu);
            // Sets the new menu bar on the frame
            frame.setJMenuBar(menuBar);
            frame.pack();
            frame.setVisible(true);
        } // HelloWorld
        public static void addFrameContents(JFrame frame, JMenuBar menuBar, JMenu menu)
            // Adds the menu to the menu bar.
            menuBar.add(menu);
            // Creates a new item for the menu with a small icon.
            JMenuItem menuLoad = new JMenuItem("Load", new ImageIcon("C:/load.gif"));
            // Adds the new item to the menu.
            menu.add(menuLoad);
            JMenuItem menuSave = new JMenuItem("Save", new ImageIcon("C:/save.gif"));
            menu.add(menuSave);
            JMenuItem menuQuit = new JMenuItem("Quit", new ImageIcon("C:/quit.gif"));
            menu.add(menuQuit);
            // Creates a new container.
            Container contents = frame.getContentPane();
            // Sets a new layout for contents, in this case FlowLayout.
            contents.setLayout(new GridLayout(2, 0));
            // Adds new JLabels to the container.
            contents.add(new JLabel("< JLabel 1 >"));
            contents.add(new JLabel("< JLabel 2 >"));
            contents.add(new JLabel("< JLabel 3 >"));
            contents.add(new JLabel("< JLabel 4 >"));
            JLabel thisLabel = new JLabel("Hello");
            thisLabel.setLayout(new FlowLayout());
            JLabel thisLabel2 = new JLabel("Hello2");
            thisLabel2.setLayout(new FlowLayout());
            contents.add(thisLabel);
            contents.add(thisLabel2);
        public static void main(String [] args)
            Menus();
        } // main
    } // class HelloWorldAny help on how I can use two separate layouts in the same frame would be great!
    Regards,
    Tom

    doing this:
    Container contents = getContentPane();
    Container contents2 = getContentPane();
    does not create 2 different containers. It's just creating 2 variables that refer to the same container. There is only 1 content pane in a window/frame. A container can only have 1 layout.
    If you want to have 2 layouts, you create 2 panels with separate layouts and put what you want in each panel, and put both panels in the content page.

  • Help needed with a layout problem

    I'm trying to build a JTabbedPane where each tab has a grid of buttons. The number of buttons is variable, and I'd like the buttons to flow sort of like with FlowLayout, with four columns. I need all the buttons to be the same size, even across tabs. I tried GridLayout, which doesn't work when I have too few buttons to fill a row. It fails in different ways, depending on how I set things up. If I try to set the layout to GridLayout(0, 4) (four columns), then if one tab has one row and another has two, the buttons on the one-row tab expand vertically to the height of the two-row tab. If I try GridLayout(2,4), then if a tab has only one button, it expands horizontally to the maximum width of any of the tabs. (It also has the further problem that if the maximum number of buttons on any tab is 6, they are placed in a 2x3 array; I'm trying to get them to be 4 buttons on the first row and 2 on the second.)
    I'm hoping there's a standard layout manager that can do the job, but I'm not too familiar with the Swing manager classes. Can I get what I want without writing my own layout manager?
    Thanks,
    Ted Hopp
    [email protected]

    I didn't think it was specifically a Swing question.Well, its either Swing or AWT, people who develop GUIs are the ones who are going to have experience using layout managers.
    but if someone can point the way to how to do this with GridBagLayout, nested containersSince you finished reading the tutorial, what have you tried? You've explained your problems using a single layout manager, so what problems are you having using nested layout managers?
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Using a layout in SUBMIT statement

    Hi,
    I am calling a program from another program using a SUBMIT statement.  I'm also using a layout to do so.
    SUBMIT rffmepgax
             WITH s_fonds = s_fund-low
             WITH s_fictr = s_fc-low
             WITH s_hkont = c_gl
             WITH p_per_fr = s_poper-low
             WITH p_per_to = s_poper-high
             WITH p_fyr_fr = s_year-low
             WITH p_fyr_to = s_year-low
             WITH s_fipex = c_citem
    >>>         WITH p_disvar = '/ZTRAVEL'
             WITH p_maxsel = c_max
             WITH s_wrttp = c_vt1
             WITH s_wrttp = c_vt2
             WITH FREE SELECTIONS texpr
             AND RETURN
             EXPORTING LIST TO MEMORY.
    The problem is that /ZTRAVEL is a public layout that anyone can change.  I can rewrite the code to use a user-specific layout, but then only I can run the program.  If anyone else tries, it stops and says the layout doesn't exist. 
    Is it possible to create a public layout that cannot be changed by anyone?  What is the t-code for this?
    thanks,
    Kevin

    Hi
    USING SELECTION-SET <var>
    This addition tells the system to start the called program with the variant var
    You specify the variant in the quotes.
    Check the below links
    http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dba51a35c111d1829f0000e829fbfe/frameset.htm
    regarding calling another program from current report
    Hope this helps
    Regards
    Shilpa

  • Layout problem in PDF conversion

    Hi all,
    i am downloading spool data using the function module CONVERT_ABAPSPOOLJOB_2_PDF. But i am facing layout problem. e.g. RFBILA00(financial statement generation program) has written balancesheet data to the spool. This spool data has some 6 columns. but CONVERT_ABAPSPOOLJOB_2_PDF is writing only first 3 columns to the generated PDF file. i used 'GET_PRINT_PARAMETERS' function module also with values like layout as 'X_65_132' and 'X_90_120'. but no success. if anybody knows the answer, please let me know.
    Thanks in advance,
    Naveen

    Hi All,
    i am following the below approach to download the information from spool.
    program/spool output is an ALV List output data having 8 columns. but below approach is converting only first 5 columns in to PDF format. other 3 columns are getting truncated.
    FUNCTION /ngl/download_spoolinfo_as_pdf.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(I_SPOOL_REQUEST) LIKE  TSP01-RQIDENT
    *"     REFERENCE(I_FILENAME) LIKE  RLGRAP-FILENAME
    *"  EXCEPTIONS
    *"      DOWNLOAD_ERROR
      TABLES tsp01.
      DATA: mtab_pdf LIKE tline OCCURS 0 WITH HEADER LINE,
            mc_filename LIKE rlgrap-filename.
      DATA: mstr_print_parms LIKE pri_params,
            mc_valid(1) TYPE c,
            mi_bytecount TYPE i.
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          copies                 = '1'
          cover_page             = space
          destination            = 'locl'
          expiration             = '1'
          immediately            = space
          mode                   = space
          new_list_id            = 'X'
          no_dialog              = 'X'
          user                   = sy-uname
          line_size              = 200
          line_count             = 65
         layout                 = 'X_65_200'
          layout                 = 'X_90_120'
          sap_cover_page         = 'X'
        IMPORTING
          out_parameters         = mstr_print_parms
          valid                  = mc_valid
        EXCEPTIONS
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          OTHERS                 = 4.
      IF sy-subrc EQ 0.
        CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid              = i_spool_request
            no_dialog                = 'X'
            dst_device               = mstr_print_parms-pdest
          IMPORTING
            pdf_bytecount            = mi_bytecount
          TABLES
            pdf                      = mtab_pdf
          EXCEPTIONS
            err_no_abap_spooljob     = 1
            err_no_spooljob          = 2
            err_no_permission        = 3
            err_conv_not_possible    = 4
            err_bad_destdevice       = 5
            user_cancelled           = 6
            err_spoolerror           = 7
            err_temseerror           = 8
            err_btcjob_open_failed   = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed  = 11
            OTHERS                   = 12.
        IF sy-subrc EQ 0.
          mc_filename = i_filename.
          DATA: lv_filename TYPE string.
          lv_filename = i_filename.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              bin_filesize = mi_bytecount
              filename     = lv_filename
              filetype     = 'BIN'
            TABLES
              data_tab     = mtab_pdf
            EXCEPTIONS
              OTHERS       = 22.
          IF sy-subrc EQ 0.
            WRITE:/ mc_filename, 'CONVERTED TO PDF AND DOWNLOADED'.
          ELSE.
            WRITE:/ 'PROBLEM WITH DOWNLOAD'.
            RAISE download_error.
          ENDIF.
        ELSE.
          WRITE:/ 'PROBLEM WITH PDF CONVERSION'.
          RAISE download_error.
        ENDIF.
      ELSE.
        WRITE:/ 'PROBLEM GETTING PRINT PARAMETERS'.
        RAISE download_error.
      ENDIF.
    ENDFUNCTION.

  • Layout problem - multiple repeating frames

    Hi, I have a layout problem, pls help!
    Short report description:
    - Repeating Frame1 - gives 1 record, contains all other frames, variable vertical elasticity
    - - Frame2 - contains all frames beneath - variable vertical elasticity
    - - - Frame3 - variable vertical elasticity
    - - - - some boilerplates
    - - - - Repeating Frame 2 - various number of records, fixed vertical elasticity, height 100
    - - - - Repeating Frame 3 - various number of records, fixed vertical elasticity, height 30
    - - - - .. other repeating frames ..
    When reaching the bottom of a page, and there is not enough room to print a record for Repeating frame 2, a record from Repeating frame 3 is printed in the bottom.
    Next page starts with the remaining records from Repeating frame 2.. and then the remaining records from Repeating frame 3.
    For example:
    Page 1:
    Rep frame 2 - Record 1
    Rep frame 2 - Record 2
    Rep frame 2 - Record 3
    Rep frame 3 - Record 1 -- not enough space to print Record 4, so this record is printed
    Page 2:
    Rep frame 2 - Record 4
    Rep frame 2 - Record 5
    Rep frame 3 - Record 2
    How can i ensure that all records from Rep frame 2 is printed before records from Rep frame 3?

    Hi, thanks for helping me out!
    I tried to use anchors, but they had no effect when connecting top of 3 to bottom of 2, got the same layout.
    I then tried to create frames with vertical elasticity expand around both rep frame 2 and rep frame 3, and it seems to do the job.
    - Repeating Frame1 - gives 1 record, contains all other frames, variable vertical elasticity
    - - Frame2 - contains all frames beneath - variable vertical elasticity
    - - - Frame3 - variable vertical elasticity
    - - - - some boilerplates
    - - - - Frame 4 - vertical elasticity expand
    - - - - - - Repeating Frame 2 - various number of records, fixed vertical elasticity, height 100
    - - - - Frame 5 - vertical elasticity expand
    - - - - - - Repeating Frame 3 - various number of records, fixed vertical elasticity, height 30
    and so on..
    Thanks again

  • Layout problem in Swing.

    Hi,
    I have made an application in Swing containing Grouplayout on the panel.
    On that panel I keep on dragging and dropping Swing Components like push button, textboxes etc and then save it using XMLEncoder i.e. I save the complete panel.
    After saving, when I recall them using XMLDecoder, the layout is completely different.
    I mean when I drag and drop the components to make a login screen and save them and when I open the same file they all appear in different layout.
    Can anybody help me solve this issue.
    Thanks and Regards,
    Hi

    If you have a layout that requires drag and drop support then you can't use a layout manager. You need to use a "null" layout so you can randomly position components.

  • Layout Problem in swings

    I have an Layout problem. My Applications consists of a label and a panel in which some more labels are present.
    The panel should contain the scrollbar in order to view all the label that excced the size of the panel.This label and a panel should be adjacent to each other.
    My problem is, I am not getting the scroll bar to the panel when I am adding the label that excced the size of the panel, when I am adding the label adjacent to this label.

    Did you use JScrollPanel? If not, use it.

Maybe you are looking for

  • F110 - execute/clearing in future date

    Hi friends, How can I schedule that F110 just run in a future date, I mean, which is the field that I need to set up to determine that F110 will just run in one week, for exemple?! Thanks

  • YouTube links in email won't play

    My wife took her brand new iPad on a trip this week. While she was away I emailed her links to some YouTube videos of the kids I had uploaded. The videos play with no problem when we click the link in her email on a "regular" computer, but clicking t

  • Sending mail to approver in BRF Workflow

    Dear all, We use a BRF Workflwo for the approval process in SRM 7.0. Could you please indicate me how we have to configure the system  for sending a mail to the approver, when he has to confirm the Shopping-Cart? The approving - part is in place and

  • Report Painter Help - FI Reports

    Hi Gurus, I need to prepare a report via report painter for consolidating 5 company code which is using one chart of account. The client need a trial balance of all these company codes in one report (first colum show the GL account, then Description

  • Auto Call recording

    Hi Experts, I have a query that is to have a call recording function on my blackburry curve 9220, which I feel this should come as basic feature on the smart phone, I did my homework on installing third party apps but still no luck. I mainly use this