Gridbag layout problem on a tabbedpane

I am not sure whether we can do this or not but, I am trying to have a gridbag layout on a TabbedPane object.
I have a JFrame on which I am adding a TabbedPane object called "t" and on this TabbedPane I am adding a tab called "Insert" which is an object of class "Insert Data". Then, I add the TabbedPane t on the Container cp, which is inside the JFrame.
In the InsertData Class (a JPanel), I need to have the gridbag layout. With this gridbag layout object, I am trying to place different objects like buttons, at various places, on this JPanel. But nothing moves on this panel.
In short, please let me know how can I have a gridbag layout on a Tabbedpane.
The Main Class is as follows:
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JTabbedPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Main extends JFrame implements ActionListener, ChangeListener{
     Main(){
               setPreferredSize(new Dimension(1200,600));
               Container cp = getContentPane();
               JTabbedPane t = new JTabbedPane();
               // insert
               InsertData insertOptions = new InsertData();
               t.addTab("Insert",insertOptions);
               cp.add(t);
               this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
               pack();
               setVisible(true);
          @Override
          public void actionPerformed(ActionEvent arg0) {
               // TODO Auto-generated method stub
          @Override
          public void stateChanged(ChangeEvent arg0) {
               // TODO Auto-generated method stub
          public static void main(String args[]){
               new Main();
     }The InsertDataClass is:
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class InsertData extends JPanel{
     InsertData(){
          setPreferredSize(new Dimension(1200,600));
          setBackground(Color.blue);
          //setLayout(new GridBagLayout());
          GridBagLayout gb = new GridBagLayout();
          setLayout(gb);
          GridBagConstraints c = new GridBagConstraints();
          //c.insets = new Insets(2, 2, 2, 2);
          //JPanel p1= new JPanel();
          //p1.setPreferredSize(new Dimension(200,200));
          JButton b1 = new JButton("here i am!!!");
          //p1.add(b1);
          //c.fill = GridBagConstraints.HORIZONTAL;
          //c.anchor = GridBagConstraints.WEST;
          c.gridx=0;
          c.gridy=1;
          add(b1,c);
}

how can I have a gridbag layout on a Tabbedpane.Huh? You post an example with just one JButton and no weightx / weighty set and you expect others here to be able to see a problem with your layout?
Also, there's needless, unused code that is just clutter -- like the unimplemented ActionListener and ChaneListener. Recommended reading: [SSCCE (Short, Self Contained, Compilable and Executable, Example Program)|http://mindprod.com/jgloss/sscce.html].
Finally, I don't see any need whatsoever to extend JFrame and JPanel as you are not introducing any new behavior of either. Always favor composition over inheritance.
I plugged in some code I had used for someone else's GridBagLayout problems and this will show you that there's no difference in using GridBagLayout in a tabbed pane component or anywhere else.import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.*;
public class GridBagInTabbedPane {
  public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        new GridBagInTabbedPane().makeUI();
  public void makeUI() {
    Font fontButton = new Font("Arial", Font.BOLD, 10);
    Font fontLabel = new Font("Arial", Font.BOLD, 15);
    JLabel labelEnter = new JLabel("Enter sentences in the text area ");
    labelEnter.setFont(fontLabel);
    JTextArea textArea = new JTextArea();
    textArea.setPreferredSize(new Dimension(630, 280));
    JScrollPane scrollPane = new JScrollPane(textArea);
    scrollPane.setMinimumSize(new Dimension(630, 280));
    JLabel labelDuplicates = new JLabel("Duplicates will appear here");
    labelDuplicates.setMinimumSize(new Dimension(650, 30));
    labelDuplicates.setFont(fontLabel);
    JButton buttonDisplay = new JButton("Display Map");
    buttonDisplay.setFont(fontButton);
    JButton buttonClear = new JButton("Clear");
    buttonClear.setFont(fontButton);
    JPanel panel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 2;
    gbc.fill = GridBagConstraints.NONE;
    gbc.anchor = GridBagConstraints.CENTER;
    gbc.insets = new Insets(5, 5, 5, 5);
    gbc.weightx = 0.5;
    panel.add(labelEnter, gbc);
    gbc.gridy = 1;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.weighty = 0.5;
    panel.add(scrollPane, gbc);
    gbc.gridy = 2;
    gbc.fill = GridBagConstraints.NONE;
    gbc.weighty = 0.0;
    panel.add(labelDuplicates, gbc);
    gbc.gridy = 3;
    gbc.gridwidth = 1;
    gbc.anchor = GridBagConstraints.EAST;
    panel.add(buttonDisplay, gbc);
    gbc.gridx = 1;
    gbc.anchor = GridBagConstraints.WEST;
    panel.add(buttonClear, gbc);
    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.add(panel);
    JFrame frame = new JFrame();
    frame.add(tabbedPane);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);
}db

Similar Messages

  • JPanel Positiong with Gridbag Layout Problem

    Hi,
    I'm desingning an UI in which I made a JFrame and set it Layout as gridBag layout. Now I have added Three JPanel in this JFrame.
    The problem is that All the three JPanels are shown in center While I want to palce them in top left corner.
    I have done this through NetBeans 4.0 in the layout coustomize option I've set them in first in the left top most, second in below of the first and so on but when I run the application The JPanel are shown in the center in this Particular position i.e first at the top in center second below to the fist and so on.
    Kindly solve my this problem.
    Regards,
    Danish Kamran.

    To get better help sooner, post a SSCCE that clearly demonstrates your problem.
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    db

  • Possible Problem/Bug In GridBag Layout ????

    I've done hundreds of Gridbag layouts in the past 2 years and just noticed this weird little behavior today.....
    Basically what I'm trying to do is arrange panels like this.....
    +--------+--------+--------+
    |        |        |        |
    |   A    |    B   |   C    |
    |        |        |        |
    +--------+----+---+--------+
    |             |            |
    |     D       |      E     |
    |             |            |
    +-------------+------------+The obvious thing to do is to
    o make the gridwidths of
    B, D, E = 2
    A, C = 1
    D and E should each share one unit of
    B's 2 width.
    Tried it in my code with my real UI and it didn't work, so then I tested it
    out using a Gridbag tool where you can set parameters on the fly quickly and
    surely enough it did not work there either.
    The GridBagLayout is refusing to split B into 2 portions for the 2nd row
    to use in an unalligned fashion. I either get
    +--------+--------+--------+
    |        |        |        |
    |   A    |    B   |   C    |
    |        |        |        |
    +--------+----+---+--------+
    |        |                 |
    |     D  |           E     |
    |        |                 |
    +--------+-----------------+  or
    +--------+--------+--------+
    |        |        |        |
    |   A    |    B   |   C    |
    |        |        |        |
    +--------+----+---+--------+
    |                 |        |
    |     D           |  E     |
    |                 |        |
    +--------+--------+--------+ depending on the order in which I add my panels to the layout.
    even though my gridx, gridy and widths and heights are properly set for
    obtaining the result I want.
    Can someone confirm that this is a bug in the GridBagLayout or share the trick for
    getting around this?

    Thanks for the reply - I can set the weights however
    I wish and I never see box D extending even one pixel
    into the A-B boundary.This does what you say...
    import java.awt.*;
    import javax.swing.*;
    public class TestFrame extends JFrame {
      public TestFrame() {
        JPanel panel = new JPanel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.weighty = 0.5; 
        panel.add(new JButton("A"), gbc);
        gbc.gridx = 1;   
        gbc.gridwidth = 2; 
        panel.add(new JButton("B"), gbc);
        gbc.gridx = 3;   
        gbc.gridwidth = 1;
        panel.add(new JButton("C"), gbc);
        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.gridwidth = 2;
        gbc.weightx = 0.5;
        panel.add(new JButton("D"), gbc);
        gbc.gridx = 2;
        panel.add(new JButton("E"), gbc);
        getContentPane().add(panel);
        setSize(400, 300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
      public static void main(String[] args) {
        TestFrame frame = new TestFrame();
        frame.setVisible(true);
    }But i'm sure it's not a satisfactory layout because button A does not want to resize horizontally at all. But of course, a mix of grid layouts does the trick:
    import java.awt.*;
    import javax.swing.*;
    public class TestFrame extends JFrame {
      public TestFrame() {
        JPanel panel = new JPanel(new GridLayout(2, 1));
        JPanel top = new JPanel(new GridLayout(1, 3));
        top.add(new JButton("A"));
        top.add(new JButton("B"));
        top.add(new JButton("C"));
        panel.add(top);
        JPanel buttom = new JPanel(new GridLayout(1, 2));
        buttom.add(new JButton("D"));
        buttom.add(new JButton("E"));
        panel.add(buttom);
        getContentPane().add(panel);
        setSize(400, 300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
      public static void main(String[] args) {
        TestFrame frame = new TestFrame();
        frame.setVisible(true);
    }

  • JTextArea & Gridbag layout - max size of control

    Hello everyone:
    I am currnetly using a JTextArea with the Gridbag layout. I want to limit the size of the JTextArea. Found an article when I did a "search" that says the size is actually controlled by the layout manager. Have tried setMaximunSize(), no luck. It appears the layout manager ignores this. The problem I am having is that I can set the size I want, however if the user types a lot of text in to the JTextArea, the control expands and over and "pushes" the controls below it down. How do I keep the layout manager from allowing this to happen?
    Thanks in advance, Bart

    Hello everyone:
    I am currnetly using a JTextArea with the Gridbag
    layout. I want to limit the size of the JTextArea.
    Found an article when I did a "search" that says the
    size is actually controlled by the layout manager.
    Have tried setMaximunSize(), no luck. It appears the
    layout manager ignores this. The problem I am having
    is that I can set the size I want, however if the user
    types a lot of text in to the JTextArea, the control
    expands and over and "pushes" the controls below it
    down. How do I keep the layout manager from allowing
    this to happen?
    Thanks in advance, Bart Do you wish to allow the user to enter as much text as he or she likes? If so, wrap the JTextArea in a JScrollPane and set the preferred size of the JScrollPange to the area you'd like the pane to consume. It'll listen, no doubt. :)

  • Gridbag layout continues to confound me...

    I am having problems with the gridx and gridy constraints when trying to use gridbag layout. They seem to have no effect when I use them. The button always appears in the top left of the panel. Other constraints seem to work as expected.
    For example: c2.fill = GridBagConstraints.BOTH; will fill up the entire panel with my button.
    Any advice on what I am doing wrong this time?
    Thanks
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    import javax.swing.JScrollPane;
    import javax.swing.JFrame;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.Color;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.text.*;
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Question
         public JPanel test()
              JPanel testPanel = new JPanel(new GridBagLayout());
              GridBagConstraints c2 = new GridBagConstraints();
              c2.insets = new Insets(5,5,5,5);
              c2.weightx = 1.0;
              c2.weighty = 1.0;
              c2.anchor = c2.NORTHWEST;
              JButton redButton = new JButton("Button");
              c2.gridx = 2;
              c2.gridy = 2;
              //c2.fill = GridBagConstraints.BOTH;//this works as expected
              testPanel.add(redButton,c2);
              return testPanel;
         public Container createContentPane()
              //Create the content-pane-to-be.
              JPanel contentPane = new JPanel(new BorderLayout());
              contentPane.setOpaque(true);
              return contentPane;
         private static void createAndShowGUI()
              //Create and set up the window.
              JFrame frame = new JFrame("question");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              //Create and set up the content pane.
              Question demo = new Question();
              frame.setContentPane(demo.createContentPane());
              frame.add(demo.test());
              //Display the window.
              frame.setSize(400, 400);
              frame.setVisible(true);
        public static void main(String[] args)
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable()
                public void run()
                    createAndShowGUI();
        }//end main
    }//end Question

    GridBagLayout keeps zero width/height grid for non-existant component for the grid.
    You could override this behavior by using GBL's four arrays as shown below.
    However, in order to get the desired layout effect, using other layout manager, e.g. BoxLayout and/or Box, is much easier and flexible as camickr, a GBL hater, suggests.
    Anyway, however, before using a complex API class as GBL, you shoud read the documentation closely.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Question{
      // you may adjust these values for your taste
      static final int rowHeight    = 100;
      static final int colWidth     = 100;
      static final double rowWeight = 1.0;
      static final double colWeight = 1.0;
      public JPanel test(){
        GridBagLayout gb = new GridBagLayout();
        gb = keepAllRowsAndColumns(gb, 3, 3);
        JPanel testPanel = new JPanel(gb);
        GridBagConstraints c2 = new GridBagConstraints();
        c2.insets = new Insets(5,5,5,5);
        c2.weightx = 1.0;
        c2.weighty = 1.0;
        c2.anchor = c2.NORTHWEST;
        JButton redButton = new JButton("Button");
        c2.gridx = 2;
        c2.gridy = 2;
        // c2.fill = GridBagConstraints.BOTH;//this works as expected
        testPanel.add(redButton,c2);
        return testPanel;
      GridBagLayout keepAllRowsAndColumns(GridBagLayout g, int rn, int cn){
        g.rowHeights = new int[rn];
        g.columnWidths = new int[cn];
        g.rowWeights = new double[rn];
        g.columnWeights = new double[cn];
        for (int i = 0; i < rn; ++i){
          g.rowHeights[i] = rowHeight;
          g.rowWeights[i] = rowWeight;
        for (int i = 0; i < cn; ++i){
          g.columnWidths[i] = colWidth;
          g.columnWeights[i] = colWeight;
        return g;
      private static void createAndShowGUI(){
        JFrame frame = new JFrame("question");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Question demo = new Question();
        frame.getContentPane().add(demo.test(), BorderLayout.CENTER);
        frame.setSize(400, 400);
        frame.setVisible(true);
      public static void main(String[] args){
        javax.swing.SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            createAndShowGUI();
    }

  • Gridbag Layout and Tabbed Panes

    First off, I'm pretty new to Java, I started it around February as a school course, and it's been a pretty smooth ride. Recently, we started to code GUI, trying out different layouts and whatnot. I'm having a little trouble in this portion as our teacher did not really delve into it very much. My question concerns the GridBag layout within a panel of a tab (sorry if this is unclear, I'm talking about something that looks like this: http://www.codeproject.com/useritems/tabcontrol.asp). I don't know how to use GridBag constraints within a panel. What I used to do with GridBag was simply use some code that looked like (forgive me, this might not be very accurate): AddComponent button1(#, #, #, #) and define what each of those numbers meant later (first would be row, second would be column, third would be width, fourth would be height, for example). But now, with the tabs, each button, label, or any other control would be declared, then I would place a bunch of direct constraints after, like this:
    JButton button1 = new JButton("1");
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.gridwidth = 1;
    constraints.gridheight = 1;then add them into the panel like this:
    panel1.add(button1, constraints);However, I have tried making the buttons on top of each other, and other patterns, but it would just place the buttons next to each other within the panel. How do I make it so that the constraints work? Or rather, if they do work, what kinda things might mess it up? I think the problem is that I dunno how to make the constraints specific to that one button.
    Also, how do I make each panel a certain size instead of each panel being as small as possible to contain anything within it.
    I'm sorry if this all sounds very vague, I'd be more than happy to give you any needed information. Also, I'm not asking any of you to do my homework, I just need a little clarification or an example. Just in case, here's the code I'm working on: http://hashasp.mine.nu/paster/?1376. Be aware that there are no comments or anything, it's very bare. Also, the form may be a bit messy because I'm pretty much reusing code that was given to me, just manipulating it in a different way. Thanks a lot in advanced for your time in reading this.

    * GridBag_Demo.java
    import java.awt.*;
    import javax.swing.*;
    public class GridBag_Demo extends JFrame {
        public GridBag_Demo() {
            setTitle("GridBag Demo");
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setSize(400,300);
            setLocationRelativeTo(null);
            GridBagConstraints gridBagConstraints;
            jTabbedPane1 = new JTabbedPane();
            jPanel1 = new JPanel();
            jButton1 = new JButton();
            jButton2 = new JButton();
            jButton3 = new JButton();
            jPanel1.setLayout(new GridBagLayout());
            jButton1.setText("jButton1");
            gridBagConstraints = new GridBagConstraints();
            gridBagConstraints.insets = new Insets(2,2,2,2);
            jPanel1.add(jButton1, gridBagConstraints);
            jButton2.setText("jButton2");
            gridBagConstraints.gridy = 1;
            jPanel1.add(jButton2, gridBagConstraints);
            jButton3.setText("jButton3");
            gridBagConstraints.gridy = 2;
            jPanel1.add(jButton3, gridBagConstraints);
            jTabbedPane1.addTab("tab1", jPanel1);
            getContentPane().add(jTabbedPane1, BorderLayout.CENTER);
        public static void main(String args[]) {
            new GridBag_Demo().setVisible(true);
        private JButton jButton1;
        private JButton jButton2;
        private JButton jButton3;
        private JPanel jPanel1;
        private JTabbedPane jTabbedPane1;
    }

  • JTextArea & Gridbag layout

    Hello everyone:
    I am currnetly using a JTextArea with the Gridbag layout. I want to limit the size of the JTextArea. Found an article when I did a "search" that says the size is actually controlled by the layout manager. Have tried setMaximunSize(), no luck. It appears the layout manager ignores this. The problem I am having is that I can set the size I want, however if the user types a lot of text in to the JTextArea, the control expands and over and "pushes" the controls below it down. How do I keep the layout manager from allowing this to happen?
    Thanks in advance, Bart

    Have set the rows and columns as you suggested in the original code,and get the size I want initalially. The problem is that the JTextArea will increase past the size set so it "bleeds" downward. I looked in the Java book I have, and it says that the scrollbars for a JTextArea are provided automatically, however they do not appear when the user supplies more lines of text than there are rows. Instead the height of the control is enlarged and this in turn pushes the other controls on the pane down. Is this a mi-print in the book, ie the scroll bars are not automatically provide in a JTextArea?
    Thanks,
    Bart

  • CSS Layout Problem?

    Can someone please help me with a layout problem.
    As far as I can tell the page looks as it should in Netscape,
    Firefox, etc., but IE6 and 7 refuse to work correctly.
    The page I am working on is:
    http://www.vmtampademo.com/localangler/testpage.html
    Most of the picture caption and headline of the middle column
    is behind the picture. I attempted to force the info with a
    seperating div which seems to work sometimes. I doubt that this is
    the correct solution. What am I doing wrong?
    Thank you for the help!

    It looks fine in Firefox 2.0.0.1, Opera 9.10, and IE 7.

  • Gridbag Layout In Flex - Looking for canvasgrid

    Hello,
    I found a posting about a layout mechanism call canvasgrid,
    based on the gridbag layout principle. It is documented at
    Mannu's Blog.
    It is a very effective layout, but the download is broken, and so
    If anyone happens to have his open source reference The source
    filename is canvasgrid_v0.3.1.zip, and it was originally located
    at:
    http://tasmania.globat.com/~mannu.info/flex/canvasgrid_v0.3.1.zip
    If anyone happens to be a code squirel, like myself, and has
    a copy of this, that would be great. I will make it a part of the
    flexlib, just because it's so usefull.
    Thaks

    Hi, You can try this:
    package {
    import flash.display.MovieClip;
    import mx.core.SpriteAsset;
    import mx.core.MovieClipAsset;
    public class GameSymbols extends MovieClip {
    [Embed(source='gameSymbols.swf', symbol='Coffee')]
    private var CoffeeClass:Class;
    //CoffeeClass represents the embedded symbol.
    public function GameSymbols() {
    //Flex defines CoffeClass as a reference to a subclass of
    //SpriteAsset class - for single-frame SWF files or
    //MovieClipAsset class - for multiframe SWF files.
    var myCoffee:SpriteAsset = new CoffeeClass() as SpriteAsset;
    //var myCoffee:MovieClipAsset = new CoffeeClass() as
    MovieClipAsset;
    //You can manipulate the embedded Symbol by using the
    methods
    //and properties of the SpriteAsset or MovieClipAsset class.
    myCoffee.setActualSize(50, 50);
    myCoffee.x = 10;
    myCoffee.y = 10;
    myCoffee.alpha = 100;
    myCoffee.visible = true;
    addChild(myCoffee);
    Luk.

  • 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 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.

  • [solved] layout problem in amarok 2.02

    Hi,
    Here, I have a bad layout problem with amarok 2.02. Amarok does not fit on my screen which is 1400 pixels large! I cannot reduce the part where the collection is shown. So that it is really unpractical to use.
    I uploaded a snapshot to illustrate the problem (it is the full screen!):
    emmanuelfavrenicolin.free.fr/Public/Sna … ok202.jpeg
    Someone have the same problem ?
    I tried to install svn version but I stopped after 3 hours of compilation, it is quite a big application.
    Last edited by manouchk (2009-05-23 06:28:43)

    Well, I tried amarok2-devel 2.0.90-1 but the problem of graphic layout remains similar, no improvement. Is it normall? Maybe amarok is only available for computer with screen >= 1600x1200  or is there an hidden configuration file where I could tweek this?
    Last edited by manouchk (2009-05-18 02:41:03)

  • Urgent: Layout problem in "light inner page"

    Hi Experts,
    I am facing a problem in portal content area on external facing portal. I see a vertical scroll bar which restricts application from being displayed on entire screen.
    I am getting this problem after a patching of EP 7.0, before patching every thing was running fine.
    To me it looks like a layout problem in "light inner page", When I use "Light - 1: column (Full width)" layout I get a vertical scroll bar on portal. When I use default layout then this vertical scroll bar disappears but I see an empty navigation bar on left side which is not required.
    Can some one advise a solution for this.
    -Lave

    hi,
    Similar problem in this thread. check it out
    Desktop inner page lost
    Regardss,
    Ganesh N

  • How to make JLabel Left Justified in Gridbag Layout?

    Hi Govind here I am using Gridbag layout and having Labels and TextBox . i want my All my Labels Left Justified (Currently they are RightJustified),I tried JLabel.Left but not working so any help most welcome............
    JLabel startDateLabel      = new JLabel("STARTDATE ",JLabel.LEFT);
              startDateLabel.setBorder( border );                                   
              //set the position of the label               
              gbc.fill = GridBagConstraints.NONE;
              usingGBC(startDateLabel,gbc,3,0,1,1.0);
                   //text field for start dat
    txtStartDate                = new JTextField();
              txtStartDate.setMinimumSize(minSize);
              txtStartDate.setPreferredSize( longField );
              txtStartDate.setEnabled( true);                    
              txtStartDate.setEditable(false);
              txtStartDate.setBackground(Color.WHITE);          
              gbc.fill = GridBagConstraints.HORIZONTAL;
              usingGBC(txtStartDate,gbc,4,0,2,1.0);
         here usingGBC is method as follows
    protected void usingGBC(Component com,GridBagConstraints gbc,int gx,int gy,int gwidth,double wx)
                   gbc.gridx = gx;
                   gbc.gridy = gy;
                   gbc.gridwidth = gwidth;
                   gbc.weightx = wx;
                   add(com,gbc);

    It seems you set the fill of the GridBagConstraints after you add the label. Either specify HORIZONTAL fill before adding the label or specify alignment for the constraints.
    Mike

Maybe you are looking for

  • Itunes won't open after I agree to lic.

    itunes won't open after I agree to lic.

  • Doubts developing web services on JDev 10.1.3.0.4

    Hi, I was trying to follow this guide http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/balusamy.html in order to develop this web service on Jdev 10.1.3.0.4. But the menus are different from the version used on the tutorial. I´m h

  • VPN not working after adding subinterface - ASA 5510

    Hello, Currently I want to add a second lan (vlan) in a customers network. The new network will be for a wireless infrastructure. There is also VPN Configured on the ASA - One with L2TP for Windows Clients and an IPsec for Cisco Clients. Former we on

  • Problem in Mail with signatures

    Has anyone experienced this? I'm running Leopard and using two different user identities("A" and "B" on my macbook. In one identity "A", I use signatures in Mail for two different email accounts. Sometimes I log out of identity "A" and use Mail in id

  • Font looks different from page to page - InDesign

    The font looks BOLD in page 1 but looks correct in page 2/3.  The font is exactly the same (from what I can tell).  It also seems to be a page thing, because I can drag the font to page 2/3 and it looks correct.  Drag it back to page 1 and it looks b