Layout Manager problems

Currently i have a nested border layout, everything is working ok except the jscrollpane, when I maximized my application it displays the maximized version at the back, and on top of it is the unmaximized version of the scrollpane, so I now have two horizontal scrollbar.
this occurs randomly

Hi nadi - perhaps you might take a look at the border layout.
+----------------------+
|             N        |
+---+-------------+----+
| W |     CENTER  |  E |
+---+-------------+----+
|            S         |
+----------------------+If the West and East sections are empty, the center, north, and south will have identical widths, and each will assume the height of the widgets it contains.
Hope this helps!
Steve

Similar Messages

  • Please help ! LAYOUT-MANAGER-PROBLEMS !

    Hi !
    I have a big problem with using the rigth layoutmanager for my GUI.
    I have a JScrollPane and want to add several JPanels to it. These Panels should have to same width, but different height. So I used a GridBagLayout and it works good.
    GridBagLayout layout = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(10,2,5,2);
    JPanel inputPanel = new JPanel(layout);
    c.gridwidth = GridBagConstraints.REMAINDER;
    // add several lines to inputPanel
    JPanel line;
    line = new JPanel(new GridLayout(1,2));
    layout.setConstraints(line,c);
    inputPanel.add(line);
    line = new JPanel(new GridLayout(1,2));
    layout.setConstraints(line,c);
    inputPanel.add(line);
    line = new JPanel(new GridLayout(1,2));
    layout.setConstraints(line,c);
    inputPanel.add(line);
    scroll = new JScrollPane(inputPanel);
    But another property should be that the width should be tried on at the current size of the JScollPane. So I used a GridLayout and the width of my JPanel's were good, but of course they all had the same height.
    GridLayout layout = new GridLayout(0,1);
    JPanel inputPanel = new JPanel(layout);
    // add several lines to inputPanel
    JPanel line;
    line = new JPanel(new GridLayout(1,2));
    layout.setConstraints(line,c);
    inputPanel.add(line);
    line = new JPanel(new GridLayout(1,2));
    layout.setConstraints(line,c);
    inputPanel.add(line);
    line = new JPanel(new GridLayout(1,2));
    layout.setConstraints(line,c);
    inputPanel.add(line);
    scroll = new JScrollPane(inputPanel);
    Is there a possibility to have both properties ( different height and conformed width) ?
    Thanks very much for help !

    Hi nadi - perhaps you might take a look at the border layout.
    +----------------------+
    |             N        |
    +---+-------------+----+
    | W |     CENTER  |  E |
    +---+-------------+----+
    |            S         |
    +----------------------+If the West and East sections are empty, the center, north, and south will have identical widths, and each will assume the height of the widgets it contains.
    Hope this helps!
    Steve

  • Urgent: Layout Manager mess

    Hi everybody!
    I am trying to do a simple application that should draw a diagram on the screen. The diagram should look like this:
    a column of rectangles (I used JLabels) alternate with a column of vertical lines (again JLabels).
    To do so I've used a GridLayout for displaying the columns and inside the columns I've used a BoxLayout for arranging items.
    Here is the problem: now I have to connect the rectangles with the vertical lines using horizontal lines, but I don't know how to do this, unless I use absolute positioning.
    Any idea about that?
    Thanks

    Connecting the recangles to the verticals with horizontal lines?
    That's a bit unclear :)
    Connecting the vericals with horizontal lines would make crosses?
    Anyway it doesn't sound like a layout management problem, more like a painting problem.
    Maybe you wanna extend JComponent and overwrite paintComponent(Graphics g) and just draw
    with g.drawLine etc
    Seems like you are trying to make a table?
    Check out the JTable tutorial.
    It's not that straightforward, but just copying and pasting the tutorials code should get you an easy table.

  • Problems with integrating YUI Layout Manager with APEX

    Hello,
    I have a problem about the YUI Layout Manager and APEX.
    This is the link to the Layout Manager, which I want to integrate:
    http://developer.yahoo.com/yui/layout/
    I tried to integrate it and in Firefox everything is fine!
    But with Internet Explorer the page is damaged.
    Look at the sample on apex.oracle.com:
    http://apex.oracle.com/pls/otn/f?p=53179:1
    Can anybody help me with this issue?
    I think this couldn`t be a big problem, becaus in FF it works correctly, but I don`t get the point to run that in IE7.
    Thank you,
    Tim

    Hello,
    now I put some color in it, but it does not help me pointing out the problem.
    The Login for my Account is:
    My Workspace is: EHRIC02
    Username: [email protected]
    Password: ehric02
    Is there anybody who have implementet the YUI Layout Manager with APEX? Perhaps that isn`t possible with APEX?
    I know that John Scott played with YUI a few times, has he tried out the Layout Manager?
    Thank you,
    Tim

  • Does anyone know how to win a fight with layout manager?

    I am using the form designer in netBeans to design my page, which has a jPanel on the left and a number of controls on the right.
    My problem is that when I eventually get it to look half right at design time, it looks different at run time. The fonts are different, the combo boxes are a different height and some of my text boxes are 4 times as wide. http://RPSeaman.googlepages.com/layout.GIF shows both the design-time view and the run-time view. How can I win my fight with layout manager?

    I'd like to do an experiment where you take say 20 pairs of students of java, with each pair matched in terms of prior programming and java experience, general knowledge, etc... and set one of each pair to learn Swing using netbeans and its layout generator with the other pair learning to code Swing by hand. Then 6 months later compare their abilities. I'll bet that the code by hand group will blow the other group out of the water in terms of understanding and ability.
    Just my 2 Sheckel's worth.

  • Crystal Layout Import problem in SAP 8.81 PL 07

    Hello
    When i import Crystal Report by
    Administrator
    Setup
    General
    Report & Layout Manager
    When i click on Import button Then i click on next button  it can't go ahead
    when i close SAP 3 to 4 times its go ahead for path selection but i have to close SAP many times
    So what is the exact problem?

    Hi Jaykumar,
    You are absolute right some times this type of situation occured in SAP but there is no permanent solution for this.
    You have to upgrade your SAP to next PL and try again. otherwise
    Goto -> Crystal Reports -> Add-ins.
    Thanks,
    Srujal Patel

  • Placing components without layout manager not working

    Hey there, I am working on a java game version of pong which I have begun to try and do using Java Swing. The problem I am currently having is reposition the components in the main window part of the game which is were the user can start a new game or close the program. I having tried using the absolute positioning by setting the layout manager to null but then everything goes blank. I can't figure out why this is not working. Here is the code so far...
    import javax.swing.*;
    import java.awt.*;
    public class SwingPractice extends JFrame
        private Container contents;
        private JLabel titleLabel;
        private JButton startGameButton;
        public SwingPractice()
            super("SwingPractice");       
            contents = getContentPane();
            contents.setLayout(null);
            this.getContentPane().setBackground(Color.BLUE);
            startGameButton = new JButton("Start Game");
            startGameButton.setFont(new Font("Visitor TT1 BRK", Font.PLAIN, 24));
            startGameButton.setForeground(Color.cyan);
            startGameButton.setBackground(Color.blue);       
            startGameButton.setBounds(350,350, 75, 75);
            titleLabel = new JLabel("The Amazing Ping Pong Game!!");
            titleLabel.setForeground(Color.cyan);
            titleLabel.setBackground(Color.blue);
            titleLabel.setOpaque(true);
            titleLabel.setFont(new Font("Visitor TT1 BRK", Font.PLAIN, 24));
            titleLabel.setBounds(0,350, 75, 75);
            contents.add(startGameButton);
            contents.add(titleLabel);
            setSize(700,350);
            setResizable(false);
            setVisible(true);
        /*private class SwingPracticeEvents implements ActionListener
        public static void main(String [] args)
            SwingPractice window = new SwingPractice();
            window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       Any other critiquing would be greatly appreciated. Thank you.
    Edited by: 804210 on Oct 21, 2010 1:30 PM

    804210 wrote:
    Hey there, I am working on a java game version of pong which I have begun to try and do using Java Swing. The problem I am currently having is reposition the components in the main window part of the game which is were the user can start a new game or close the program. I having tried using the absolute positioning by setting the layout manager to nullDon't. Ever. Never. Well, mostly.
    Read the tutorial chapter about [url http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html]Laying out components. It even features a section on absolute positioning - which you should skip reading, of course! :o)
    And read this old Sun topic: http://forums.sun.com/thread.jspa?threadID=5411066
    Edited by: jduprez on Oct 21, 2010 10:48 PM

  • Need suggestion regarding Layout Manager using Swing in Java

    I have developed a swing application where i am having problem with selecting the right layout manager.
    I am attaching the file where it contains the method for addingComponents to the Content Pane. But, the code that i have written
    contains lot of spaces between first panel and second panel and so forth.
    Please suggest.
    <<Code>>
    public void addComponentsToPane(Container contentPane) {
              this.contentPane = contentPane;
    //          File Panel
              JPanel jfile1panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              JPanel jfile2panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              JPanel jfile3panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
              JLabel jfile1 = new JLabel("Select File:");
              jtfile1 = new JTextField(50);
              jbfile1 = new JButton("Button1");
              jfile1panel.add(jfile1);
              jfile1panel.add(jtfile1);
              jfile1panel.add(jbfile1);
              jbfile1.addActionListener(this);
              JLabel jfile2 = new JLabel("Select File:");
              jtfile2 = new JTextField(50);
              jbfile2 = new JButton("Button2");
              jfile2panel.add(jfile2);
              jfile2panel.add(jtfile2);
              jfile2panel.add(jbfile2);
              jbfile2.addActionListener(this);
              JLabel jfile3 = new JLabel("Select File:");
              jtfile3 = new JTextField(50);
              jbfile3 = new JButton("Button3");
              jfile3panel.add(jfile3);
              jfile3panel.add(jtfile3);
              jfile3panel.add(jbfile3);
              jbfile3.addActionListener(this);
              //Button Panel
              JPanel jbuttonpanel = new JPanel();
              jbuttonpanel.setLayout(new FlowLayout(FlowLayout.CENTER));
              JButton jbcmd1 = new JButton("Submit");
              JButton jbcmd2 = new JButton("Cancel");
              jbuttonpanel.add(jbcmd1);
              jbuttonpanel.add(jbcmd2);
              jbcmd1.addActionListener(this);
              jbcmd2.addActionListener(this);
              //Content Pane               
              contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
              contentPane.add(jfile1panel);
              contentPane.add(jfile2panel);
              contentPane.add(jfile3panel);
              contentPane.add(jbuttonpanel);
    }

    But, the code that i have written contains lot of spaces between first panel and second panel and so forth.use pack(), see if it makes a difference
    as you're using FlowLayout, make the frame not resizable

  • Layout manager issue.

    I was hoping that someone could shed some light on why one layout manage will allow an applet to be inserted in a class that extends JFrame but not another.
    Here is the guts of the problem I have an class that extends applet to display a pie chart. I then have a seperate class that extends JFrame that display two input boxes and a button. When the user enters two fields and clicks draw the pie chart displays working with the two numbers. The JFrame class that works uses the border layout. I change the class to use gridbag, and now only the textboxes display. Can anyone help. Here is the code for the three classes.
    This is the applet class....
    * File: PieChart.java
    * PieChart class is an Swing applet that use a pie chart
    * to show the percentage. It is used by PieChartExample
    * to show what percetange of a payment actually goes to
    * pay interest. There is no error handling in the program.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class PieChart extends JApplet {
    final static Color bg = Color.white;
    final static Color fg = Color.black;
    private double percent;
    public void init() {
    //Initialize drawing colors
    setBackground(bg);
    setForeground(fg);
    percent = 1.0;
         public void setPercentage(double pct) {
              this.percent = pct;
    public void paint(Graphics g) {
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setPaint(fg);
    drawAnnotation(g2);
    drawArc(g2, percent);
    public void drawAnnotation(Graphics2D g2) {
              // draw a small green circle
              g2.setPaint(Color.green);
    g2.fill(new Ellipse2D.Double(200, 200, 10,10));
    // draw a small red circle
    g2.setPaint(Color.red);
    g2.fill(new Ellipse2D.Double(270, 200, 10, 10));
    g2.setPaint(Color.black);
    g2.drawString("Interest", 210, 210); // write "Interest" by green circle
    g2.drawString("Principal", 280, 210); // write "Principal" by red circle
         public void drawArc(Graphics2D g2, double percent) {
    // draw the interest portion
              g2.setPaint(Color.green);
              g2.fill(new Arc2D.Double(10,10,200,200, 0, percent * 360, Arc2D.PIE));
              // draw the rest (principal portion)
              g2.setPaint(Color.red);
              g2.fill(new Arc2D.Double(10,10,200,200, percent * 360, (1-percent)*360, Arc2D.PIE));
    This is the JFrame class using Boarderlayout that works.
    * File: PieChartExample.java
    * The program demonstrate a simple use of pie chart. It takes total
    * payment and interest paid from user input and draws a pie chart
    * to show the percentage of interert to total payment. There is no
    * error handling whatsoever in the example program, so you can see
    * that it can be broken easily.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class PieChartExample extends JFrame {
         final static int CHART_WIDTH = 800;
         final static int CHART_HEIGHT = 300;
         JPanel panel ;
         JLabel paymentLabel;
         JTextField paymentField;
         JLabel interestLabel;
         JTextField interestField;
         JButton show;
    PieChart applet;
    public PieChartExample() {
    super("Pie Chart Example");
    panel = new JPanel();
    paymentLabel = new JLabel("Payment: $");
    panel.add(paymentLabel);
    paymentField = new JTextField(10);
    panel.add(paymentField);
    interestLabel = new JLabel("Interest: $");
    panel.add(interestLabel);
    interestField = new JTextField(10);
    panel.add(interestField);
    show = new JButton("Draw");
    panel.add(show);
    this.getContentPane().add("North", panel);
    applet = new PieChart();
    this.getContentPane().add("Center", applet);
    show.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent evt) {
                        double interest = Double.parseDouble(interestField.getText());
                        double payment = Double.parseDouble(paymentField.getText());
                        double percent = interest / payment;
                        //System.out.println("In event handler, percent is " + percent);
                        applet.setPercentage(percent);
                        applet.repaint();
    private static void createAndShowGUI() {
    PieChartExample f = new PieChartExample();
    f.pack();
    f.setSize(new Dimension(CHART_WIDTH ,CHART_HEIGHT));
    f.show();
    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();
    This is the modified class to use GridBag that fails.
    * File: PieChartExample2.java
    * The program demonstrate a simple use of pie chart. It takes total
    * payment and interest paid from user input and draws a pie chart
    * to show the percentage of interert to total payment. There is no
    * error handling whatsoever in the example program, so you can see
    * that it can be broken easily.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class PieChartExample2 extends JFrame {
         final static int CHART_WIDTH = 800;
         final static int CHART_HEIGHT = 300;
         JPanel panel ;
         JLabel paymentLabel;
         JTextField paymentField;
         JLabel interestLabel;
         JTextField interestField;
         JButton show;
    PieChart applet;
    public PieChartExample2() {
    super("Pie Chart Example");
    // Get container and set layout manager
    Container contentPane = getContentPane();
    GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    contentPane.setLayout(gridbag);
    c.fill = GridBagConstraints.HORIZONTAL;
    panel = new JPanel();
    paymentLabel = new JLabel("Payment: $");
    panel.add(paymentLabel);
    paymentField = new JTextField(10);
    panel.add(paymentField);
    interestLabel = new JLabel("Interest: $");
    panel.add(interestLabel);
    interestField = new JTextField(10);
    panel.add(interestField);
    show = new JButton("Draw");
    panel.add(show);
    c.gridx = 0;
    c.gridy = 0;
    gridbag.setConstraints(panel, c);
    contentPane.add(panel);
    applet = new PieChart();
    c.gridx = 0;
    c.gridy = 1;
    gridbag.setConstraints(applet, c);
    contentPane.add(applet);
    show.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent evt) {
                        double interest = Double.parseDouble(interestField.getText());
                        double payment = Double.parseDouble(paymentField.getText());
                        double percent = interest / payment;
                        //System.out.println("In event handler, percent is " + percent);
                        applet.setPercentage(percent);
                        applet.repaint();
    private static void createAndShowGUI() {
    PieChartExample2 f = new PieChartExample2();
    f.pack();
    f.setSize(new Dimension(CHART_WIDTH ,CHART_HEIGHT));
    f.show();
    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();
    }

    Ok. It seems I may be wrong and that this may not be a concurrent call issue. I overode the components setBounds and setLocation methods and it appears that an external class is updating the position of these components while layoutContainer is attempting to position them. I can see that the correct positions are being set in the setBounds method, but this is happening after layoutContainer has called getLocation on the components. To be a little more specific, I am using a JLayeredPane to display some overlapping JLabels with images. I have implemented drag and drop on these labels so that dropping one on another swaps the images. The label positions and sizes are not being changed during the drop (I don't want them to move or resize just change images). However, for some reason I have yet to discover, two calls to set bounds are being made on the labels. The first call is relocating the label to the second labels position, the second call is relocating the label back to it's original position. If anyone has any insight on why the label position are changing when I am not explicitly repositioning them please reply. I will post another reply when I have corrected the problem or found a work around for it. I am awarding the dukes to tjacobs1 since he was the only responses I've had so far.

  • Missing reports in Report and Layout manager

    Hi Experts,
    i need to convert with Crystal Converter some PLD Tax reports.
    The problem is that under Tax Reports tree, in report and layout manager, reports of typecode 'RB01' are missing!
    Why are they missing??
    Is there any other way to convert them even if missing?
    i can see them in the tax report form, selecting tax register block and press ok.
    From the print layout designer they are listed.
    Please help.
    Thanks
    Paolo

    Hi Paolo,
    What is your B1 PL? Have you solved your problem? Try to upgrade to the latest PL if you are not in it.
    Thanks,
    Gordon

  • Image (jpeg, gif) display in AWT layout manager

    Goodmorning All,
    I am looking for some help, a hint on my AWT Layout challenge i have.
    Example GUI_1:
    =========================
    Window border..................[_][x]..
    =========================
    [label]....|display_area|....[button].
    [label]....|display_area|....[button].
    ...............|display_area|....[button].
    ...............|display_area|....[button].
    ...............|display_area|..................
    =========================
    ...........................................[QUIT].....
    =========================
    I want to
    - display a picture in the "display area" of the this GUI
    - put labels left of it with some text
    - put a couple of buttons right of it, through which i am able to manipulate the image
    Questions:
    *1. Is it (even) possible to display an (jpeg,gif) image in the "display area" while using a layout manager?*
    Surfing over the internet...so far i only have found applet-examples that use the full gui surface of the applet to display an image via the g.drawImage (imagename, x,y); without any gui elements (labels, buttons) beside it.
    *2. What kind of AWT gui element do i need at the location of the "display area"?*
    Is is possible to use a CANVAS or do i need somethen else? (e.g. glue an image on a button)
    *3. Is is possible to display an ANIMATION (series of sequences jpeg, gifs) in the display area?*
    I already found out how to locate and load the images (via mediatracker).
    Now i need to find a way to "paint" the loaded images in the GUI.
    *4. Is this even possible with AWT layout or do i need to switch to SWING layout?*
    I have not used Swing yet, cause i'm working my way up through the oldest gui technologie first.
    *5. Do know any usefull websites, online tutorials (on awt and displaying images) that can help me tackle my challenge?*
    Thank you very much for your hints, tips and tricks

    A link as Gary pointed out is the best way to see what the problem may be.
    Did you save the image to your working folder and have you defined a site pointing to this folder.
    Defining a site helps Dreamweaver track and organize the files used in this site.
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14028
    If you can't see the image, this means that the path to the image is incorrect.
    Nadia
    Adobe Community Expert : Dreamweaver
    Unique CSS Templates | Tutorials | SEO Articles
    http://www.DreamweaverResources.com
    Web Design & Development
    http://www.perrelink.com.au
    http://twitter.com/nadiap

  • How to force a Layout manager to recompute placement

    Hi,
    I would like to know how i can force a Layout Manager to recompute
    size of components in a JFrame and redraw all of them.
    My problem: I have a JTree inside a BorderLayout and when i open
    path in the tree i would like that the tree is resized to show
    all the text. This is done when i resize the window i would like
    that is done also when i click on the JTree
    Thanks for help

    Well I can tell you what I do, Im not sure how correct it is! I use the revalidate() and repaint() methods on the frame, and it should revalidate the components. Or removeAll() from the frame and re add frame.add(components); again.
    Hope this makes a bit of sense. Post code if you want, then i can take a proper look.

  • Doing without layout manager

    Hi guys.
    I have a very complex problem.
    I've been writing a code that should be able to display a general tree. The tree has to look like an organigram, if you know what I mean. For example, the parent node is a the top and the child nodes are underneath it.
    It's clear that there is no layout manager that can handle this correctly. At least I assume.
    I used the Node Positioning of John Walker to compute the x- and y-coordinate of each node.
    I can display the nodes so far, but I don't know how to force a scrollpane to react to the size of the JPanel containing the nodes.
    In fact, the JPanel containing the nodes of the tree has a null layout manager. If it contains let say 10 nodes, it becomes big enough. However the scrollpane doesn't grow along with the panel.
    What should I do to let the scroll pane grow so that all nodes can be seen.
    Regards.
    Edmond

    It's clear that there is no layout manager that can handle this correctly. Correct. So you need to create a custom layout manager.
    I used the Node Positioning of John Walker to compute the x- and y-coordinate of each node. This is the code that should be added to your custom layout manager.
    but I don't know how to force a scrollpane to react to the size of the JPanel containing the nodes.This is the job of the layout manager. It will determine the preferred size of the panel based on the location/size of all the components added to the panel.
    Here is a simple example to get you started. This layout displays the components diagonally:
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class NodeLayout implements LayoutManager, java.io.Serializable
         private int hgap = 20;
         private int vgap = 20;
         public NodeLayout()
          * Adds the specified component with the specified name to the layout.
          * @param name the name of the component
          * @param comp the component to be added
         @Override
         public void addLayoutComponent(String name, Component comp) {}
          * Removes the specified component from the layout.
          * @param comp the component to be removed
         @Override
         public void removeLayoutComponent(Component component)
          *     Determine the minimum size on the Container
          *  @param      target   the container in which to do the layout
          *  @return      the minimum dimensions needed to lay out the
          *                subcomponents of the specified container
         @Override
         public Dimension minimumLayoutSize(Container parent)
              synchronized (parent.getTreeLock())
                   return preferredLayoutSize(parent);
          *     Determine the preferred size on the Container
          *  @param      parent   the container in which to do the layout
          *  @return  the preferred dimensions to lay out the
          *              subcomponents of the specified container
         @Override
         public Dimension preferredLayoutSize(Container parent)
              synchronized (parent.getTreeLock())
                   return getLayoutSize(parent);
          *  The calculation for minimum/preferred size it the same. The only
          *  difference is the need to use the minimum or preferred size of the
          *  component in the calculation.
          *  @param      parent  the container in which to do the layout
         private Dimension getLayoutSize(Container parent)
              int components = parent.getComponentCount();
            int width = (components - 1) * hgap;
            int height = (components - 1) * vgap;
              Component last = parent.getComponent(components - 1);
              Dimension preferred = last.getPreferredSize();
              width += preferred.width;
              height += preferred.height;
              Insets parentInsets = parent.getInsets();
              width += parentInsets.top + parentInsets.right;
              height += parentInsets.top + parentInsets.bottom;
              Dimension d = new Dimension(width, height);
              return d;
          * Lays out the specified container using this layout.
          * @param       target   the container in which to do the layout
         @Override
         public void layoutContainer(Container parent)
         synchronized (parent.getTreeLock())
              Insets parentInsets = parent.getInsets();
              int x = parentInsets.left;
              int y = parentInsets.top;
              //  Set bounds of each component
              for (Component component: parent.getComponents())
                   if (component.isVisible())
                        Dimension d = component.getPreferredSize();
                        component.setBounds(x, y, d.width, d.height);
                        x += hgap;
                        y += vgap;
          * Returns the string representation of this column layout's values.
          * @return      a string representation of this layout
         public String toString()
              return "["
                   + getClass().getName()
                   + "]";
         public static void main( String[] args )
              final JPanel panel = new JPanel( new NodeLayout() );
              panel.setBorder( new MatteBorder(10, 10, 10, 10, Color.YELLOW) );
              createLabel(panel);
              createLabel(panel);
              createLabel(panel);
              createLabel(panel);
              createLabel(panel);
              JButton button = new JButton("Add Another Component");
              button.addActionListener( new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        NodeLayout.createLabel( panel );
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.add( new JScrollPane(panel) );
              frame.add(button, BorderLayout.SOUTH);
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible( true );
         public static void createLabel(JPanel panel)
              JLabel label = new JLabel( new Date().toString() );
              label.setOpaque(true);
              label.setBackground( Color.ORANGE );
              panel.add( label );
              panel.revalidate();
              panel.repaint();
    }You would need to customize the getLayoutSize() and layoutContainer() methods to meet your Node Layout requirements.

  • Delete Crystal Report Design in Report and Layout Manager

    Hi All
    How to permanently delete a customised Crystal Report Design imported in Report and Layout Manager?
    There is no Delete button at all unlike Form Design?
    Kedalene Chong

    Hi Nagarajan
    Please see image attached, already login as superuser but there is no Delete button for imported Crystal Report Design in Report and Layout Manager.

  • Report & Layout Manager

    Hi,
    I have created User defined form. Now i have to display report when click on Preview button (Same as Standard document).
    Can we use report & layout manager to display report.
    Regards,
    Pravin

    Hello
    possible with development, and it is pending from the B1 version.
    Easy solutions are:
    - 8.81 you can use Crystal Reports and PLD
    - 2007 you can use PLD only or CR integration addon
    in Crystal:
    - You can create your layout and you can import into the system as report (not layout) into a specific folder
    - When you press the print or print preview button (eg menu action is indicated, menu id "520", "519"), then you can find the crystal report in the OCMN table with the following query
    select MenuUID from OCMN where Name = N'YOUR_REPORT_NAME'
    - next step is call the report with ActivateMenuItem and fill the parameters.
    Complete code for crystal
                Dim oRs As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
                Dim sQuery As String
                Dim sMenuID As String
                sQuery = "select MenuUID from OCMN where Name = N'YOUR_REPORT_NAME"
                oRs.DoQuery(sQuery)
                If oRs.Fields.Count > 0 Then
                    sMenuID = oRs.Fields.Item("MenuUID").Value.ToString
                    m_SBO_Application.ActivateMenuItem(sMenuID)
                    Dim oForm As SAPbouiCOM.Form = SBO_Application.Forms.ActiveForm
                    oForm.Items.Item("1000003").Specific.String = docentry
                    m_CrystalCriteriaFormID = oForm.UniqueID
                    oForm.Items.Item("1").Click(BoCellClickType.ct_Regular)
                Else : m_SBO_Application.MessageBox("NO PRINTING LAYOUT EXISTS!")
                End If
    In PLD, the logic is the same, but you must activate the User Queries print layout, and locate the report in the matrix.
    Regards
    János

Maybe you are looking for

  • Record Count Issue in Search page ?

    Hi Friends I am trying to display record count on Search page and I have the following code in The table has total of 62 Rows AM : for testing purpose, i am printing in log public void getISAGRecordCount() OAViewObject vo = (OAViewObject)getXXG2_ELIM

  • 17" vs 19" for external monitor

    With the "low" iBook resolution of 1024 x 768 (which works fine for me)- will the 19" monitor be more blurry than the 17" because the pixels are spread out more? It's important that print/type words are clear. Or I won't see any difference? Its an HP

  • Download photos from CD to iMac

    I have a CD of 122 photos from a recent vacation. Tried to download to my iMac (Snow Leopard - Ver.10.6.8). Not sure how to save them on the iMac. I double-clicked on the CD on the desktop.  I opened the folder containing the 122 JPG files (photos).

  • WARNING before relying on Number for iPad

    Warning - I have recently built a detailed new spreadsheet directly in numbers on iPad. Everything was working fine last night as I made some adjustments to it. This morning I go to open the spreadsheet again and halfway through loading all I get is.

  • Monitor email viewing through proxy

    I have a need to know if a user has used proxy rights to view individual emails. I can't seem to find any place that logs when an email has been opened (from the receiver end). Any ideas would be very helpful.