Add custom JPanel to component palette

Hi all,
i created a new JPanel,that extends JPanel class, called MyPanel. Is there a way for me to add this to the component palette?
I tried adding it to code snippets but that didn't work for me.
Christoph

Christoph,
1. right mouse click onto the component panel
2. Choose "Palette Properties"
3. Click "Add" to create a new page
4. Give it a name of your choice e.g. "My ToolBox"
5. Type should be Java
6. Click add on the Components area for "My ToolBox" to search for the component to display
Frank

Similar Messages

  • Create new / add Custom Node in Component Pallete - Workflow Editor

    is there anyway to Create new / add Custom Node in Component Pallete - Workflow Editor in SQL Developer - Oracle Data Miner?
    Now i'm in progress create data cleansing engine in database package, and I have an idea to create new node in workflow editor, the node will call my procedure data cleansing.
    Anybody help?

    Hi,
    Not currently.
    We are working on a SQL Query node that would process data on connected input nodes and allow the user to create any sql query specification they would like.
    So as long as your implementation is compatible with being included as part of a sql query, then you may be able to take advantage of this new node.
    Since you describe your implementation as a data cleansing implementation, I could see it taking in what ever input is provided in the flow, and then returning a cleansed result set.
    Thanks, Mark

  • User Exit to add custom field in Component Screen

    Hi Friends,
    I searched alot but could find exit to add custom field or tab in material component detail screen for SAP 4.7. Please let me know if there is any exit  or workaround possible.
    Thanks,
    Raj

    BADI is available to create custom field in material component , but it is available as of ECC 6.0 EHP3 , not sure about 4.7

  • BUG: Unable to add tag library to component palette on linux (Ubuntu)

    As already discussed in the thread problem with adding Sun JSF RI v1.2 as a new library in JDeveloper 10.1.3.1 i have problems adding the Apache Trinidad (faces) tag library to the component palette. Actually the adding is not the problem and initially after adding it, it works. But when closing JDeveloper and restarting the components have disappeared while they are still selected in the Edit Tag Libraries menu. This problem only occurs on Linux and not under windows.
    Kind Regards,
    Andre Jochems

    Hi,
    Thanks for reporting this issue
    Frank

  • Extension which will provide Custom Soa components from component palette.

    I was asked to created an extension which will aid in helping the development faster and enable following standards strictly.
    So I have to create an extension which will add the following functionality.
    I have to add custom components in component palette which can be dragged dropped in composite editor similar to that of JMS Adapter extra.
    So Can you please look into the requirement and give me some pointers.
    Update: I was able to add a custom component to the component palette with the help cppageprovider example. But the component does nothing.
    I want to know how the drag and dropping is done.
    How to extend BPEL designer to add my own activities palette icon/item? I am stuck at exactly the same point as his.
    I know it is difficult to get an answer during christmas! But I have deadline. :(
    Edited by: Ramasamy gopalan on Dec 26, 2011 11:22 PM
    Edited by: Ramasamy gopalan on Dec 27, 2011 2:08 AM

    Hi,
    while it is JDeveloper owning the extension framework, unfortunately we do not own the composite editor. I'll try and forward your question Oracle internally, but I have no direct access to the developer of the SOA editor extension. I deally you also continue posting to the SOA forum
    SOA Suite
    Frank

  • Component Palette

    Does JDeveloper 10g have the provision to register
    custom schemas for the Component Palette?
    For example,
    1. Create a Component Palette page of type XML with
    Tools>Configure Palette.
    2. Add Components to the Component Palette from a
    custom schema.

    Deepak,
    Are you hoping to add pages to the Component Palette to aid in the editing of a custom XML language using the JDeveloper XML Editor? If so, and you have an XML Schema, all you should have to do is register it with JDeveloper via Tools .. Preferences .. XML Schemas, using "xml" as the extension. Then when you open a document that uses your schema, you should automatically have a component palette, plus get code insight, support in the Property Inspector, insertion menus (right-click in the Structure Pane), etc.
    -brian

  • No way to add code snippets to the palette in 11g

    Hello,
    According to the Help Center, I should be able to add "codes snippets" to my palette, like I used in 10g...
    Adding a Code Snippet to the Palette
    You can add pages to the Component Palette to group your snippets, or you can add snippets to the existing Code Snippets page. Once you add snippets to the Palette, you can insert this code into any file you have open in the source editor by selecting the snippet from the Palette
    within the Configure Component Palette dialog. In the Configure Component Palette dialog, for Page Type select snippet to view only those pages containing snippets.
    Well , in the Page Type drop list , I only see "java" and "use case" ?
    I am running J2EE Edition Version 11.1.1.0.1 Build JDEVADF_MAIN.BOXER_GENERIC_081203.1854.5188
    Any thoughts ?
    Cheers

    If all you want is code snippet why not use the code template feature?
    It is more dynamic and will allow you to use variables that you can switch - then you can just use the keyboard to get the value.
    See:
    http://www.oracle.com/technology/obe/obe11jdev/11/ide/introjdevide.htm#t4s1
    http://adfjsf.blogspot.com/2009/09/creating-code-templates-in-jdeveloper.html

  • Custom Component Palette

    Hi,
    I want to know how can I create my component palette with differents controls. I want that my palette has several JSF components (JSF HTML and ADF Faces Core).
    For example, in my custom palette I have a Table (of ADF Faces Core), a InputText (of ADF Faces Core) and a PanelGrid (of JSF HTML).
    How can I do that? It is possible?
    Thanks
    Diego

    In Tools -> Configue Palette I can only create Component Palette of the following types (css, java, oxd_usc and snippet), but I can't add JSF Components in this types.
    How can I add JSF components in this types?
    Or, which is the type (css, java, oxd_usc, snippet or other) used for add JSF components?
    Thanks
    Diego

  • Extended Swing Components into Custom Component Palette

    Hi
    As part of my swing application I have a number of GUI components created as an extension of a normal swing component.
    As example is below.
    package com.myapp
    import java.awt.Font;
    import javax.swing.JLabel;
    public class MLabel extends JLabel
    public MLabel()
    this.setFont(new Font("Tohoma",0,10));
    this.setFocusable(false);
    As you can see this simple sets some default attributes. How can I add this custom component into a palette for each access when using the GUI builder.
    I've created a new page in the palette, but am unable to add my components.
    Thanks for your help.
    Nick.

    Hi,
    - create a JAR file with your component(s) in it
    - Create a custom Library in JDeveloper (Tools--> Managed Libraries)
    - Select the JAR file
    - On the component palette (the page you created), select the properties option of the context menu
    - Your library now shows up in the drop down list to choose the component to add
    Frank

  • Unable to add component palette in jdeveloper

    Hi,
    Im unable to add component palette in jdeveloper, it is giving exception and the stack trace is here below, pls let me know the solution.
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    java.lang.NullPointerException
         at oracle.ideimpl.palette.PaletteImpl.populate(PaletteImpl.java:240)
         at oracle.ideimpl.palette.PaletteWindowImpl.checkIfPopulated(PaletteWindowImpl.java:323)
         at oracle.ideimpl.palette.PaletteWindowImpl.show(PaletteWindowImpl.java:364)
         at oracle.ideimpl.palette.PaletteManagerImpl.handleEvent(PaletteManagerImpl.java:174)
         at oracle.ide.IdeAction$1.run(IdeAction.java:579)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:337)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)

    Try copying the palette.xml file from jdev\multi\system to your system directory( jdev\system(9....). Also, what system are you using?

  • How do I add ADF Faces Core and ADF Faces Html to the component palette?

    I have an already made jspx page which I wish to work further on but I can´t choose ADF components from the component palette.
    in my older version I added these two lines to the <jsp:root> element when I wanted to make ADF components available.
    xmlns:af="http://xmlns.oracle.com/adf/faces"
    xmlns:afh="http://xmlns.oracle.com/adf/faces/html"
    but in Jdeveloper 11g preview 3 these two lines seem to have no effect.
    I tried to see what other jspx pages that contained ADF components in 11g had that my page didn´t and found out that they had the line
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    but when I add this line instead of the other two lines and press install JSP tag library Jdeveloper freezes completely. Can anyone help me get ADF components show up in the component palette in Jdeveloper 11g preview 3?
    Message was edited by:
    AtlanticViking

    Hello,
    Jdeveloper 11g uses Trinidad not ADF Faces 10g, to add it, uses the following:
    1. Double-click your project to access project properties;
    2. Select JSP Tag Libraries;
    3. Click Add;
    4. Trinidad Component 11-m3
    Regards,
    ~ Simon

  • Custom JPanel moves inside JFrame when Jpanel.paintComponent(...) is called

    I have a custom JPanel (CompassCalculatorPanel) that is created, setup and placed within a custom JFrame (CompassCalcFrame). Calling the JFrame constructor sets this all up and makes the Frame show up. All is good with placement and drawing initially. Then when a user changes the spinner value (change the compass heading) it is supposed to redraw the arrow within the panel. It does this just fine, but on the repaint, and subsequent paints, the Panel ends up being placed in the upper left corner of the frame, rather than at the place I positioned it. I've tried saving the upper left corner placement coordinates and calling setBounds(...) before and after the paintComponent(...) method is called. This has no effect, the panel still resides at 0, 0.
    boldAny help that keeps the panel in place would be appreciated!*bold*
    I am opening a new CompassCalcFrame with the following code from another GUI application like this (but this works from an example program perspective):
    import com.vikingvirtual.flightsim.CompassCalcFrame;
    * @author madViking
    public class Main
        public static void main(String[] args)
            CompassCalcFrame CCF = new CompassCalcFrame();
    }The CompassCalcFrame.java code:
    package com.vikingvirtual.flightsim;
    import java.awt.Color;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Insets;
    import java.awt.Point;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JSeparator;
    import javax.swing.JSpinner;
    import javax.swing.JTextField;
    * @author madViking
    public class CompassCalcFrame extends JFrame
        private CompassCalculatorPanel ccPanel;
        private JButton closeButton;
        private JLabel frameTitle;
        private JSeparator frameSeparator1;
        private JSpinner hdgSpinner;
        private JTextField neField;
        private JTextField eField;
        private JTextField seField;
        private JTextField sField;
        private JTextField swField;
        private JTextField wField;
        private JTextField nwField;
        private Point ccPanelPoint;
        public CompassCalcFrame()
            super ("Compass Heading Calculator");
            initComponents();
            this.setVisible(true);
            calculateAndDraw();
        private void initComponents()
            this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            this.setLayout(null);
            this.setBackground(Color.BLACK);
            this.setForeground(Color.BLACK);
            Container ccPane = this.getContentPane();
            Dimension panelDim = ccPane.getSize();
            Font buttonFont = new Font("Tahoma", 0, 12);
            Font compassFont = new Font("Digital-7", 0, 24);
            Font titleFont = new Font("Lucida Sans", 1, 14);
            frameTitle = new JLabel();
            frameTitle.setText("Compass Heading Calculator");
            frameTitle.setFont(titleFont);
            frameTitle.setForeground(Color.WHITE);
            closeButton = new JButton();
            closeButton.setText("Close");
            closeButton.setToolTipText("Click to close view");
            closeButton.setFont(buttonFont);
            closeButton.addActionListener(new java.awt.event.ActionListener() {public void actionPerformed(java.awt.event.ActionEvent evt)
                                                                              {closeButtonActionPerformed(evt);}});
            hdgSpinner = new JSpinner();
            hdgSpinner.setFont(compassFont);
            hdgSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 359, 1));
            hdgSpinner.setToolTipText("Enter heading to see angles change");
            hdgSpinner.addChangeListener(new javax.swing.event.ChangeListener() {public void stateChanged(javax.swing.event.ChangeEvent evt)
                                                                                {hdgSpinnerStateChanged(evt);}});
            neField = new JTextField();
            neField.setBackground(Color.BLACK);
            neField.setEditable(false);
            neField.setFont(compassFont);
            neField.setForeground(Color.WHITE);
            neField.setHorizontalAlignment(JTextField.CENTER);
            neField.setBorder(null);
            eField = new JTextField();
            eField.setBackground(Color.BLACK);
            eField.setEditable(false);
            eField.setFont(compassFont);
            eField.setForeground(Color.WHITE);
            eField.setHorizontalAlignment(JTextField.CENTER);
            eField.setBorder(null);
            seField = new JTextField();
            seField.setBackground(Color.BLACK);
            seField.setEditable(false);
            seField.setFont(compassFont);
            seField.setForeground(Color.WHITE);
            seField.setHorizontalAlignment(JTextField.CENTER);
            seField.setBorder(null);
            sField = new JTextField();
            sField.setBackground(Color.BLACK);
            sField.setEditable(false);
            sField.setFont(compassFont);
            sField.setForeground(Color.WHITE);
            sField.setHorizontalAlignment(JTextField.CENTER);
            sField.setBorder(null);
            swField = new JTextField();
            swField.setBackground(Color.BLACK);
            swField.setEditable(false);
            swField.setFont(compassFont);
            swField.setForeground(Color.WHITE);
            swField.setHorizontalAlignment(JTextField.CENTER);
            swField.setBorder(null);
            wField = new JTextField();
            wField.setBackground(Color.BLACK);
            wField.setEditable(false);
            wField.setFont(compassFont);
            wField.setForeground(Color.WHITE);
            wField.setHorizontalAlignment(JTextField.CENTER);
            wField.setBorder(null);
            nwField = new JTextField();
            nwField.setBackground(Color.BLACK);
            nwField.setEditable(false);
            nwField.setFont(compassFont);
            nwField.setForeground(Color.WHITE);
            nwField.setHorizontalAlignment(JTextField.CENTER);
            nwField.setBorder(null);
            frameSeparator1 = new JSeparator();
            frameSeparator1.setForeground(Color.WHITE);
            frameSeparator1.setBackground(Color.BLACK);
            ccPanel = new CompassCalculatorPanel();
            // Add components to pane
            ccPane.add(frameTitle);
            ccPane.add(closeButton);
            ccPane.add(frameSeparator1);
            ccPane.add(nwField);
            ccPane.add(hdgSpinner);
            ccPane.add(neField);
            ccPane.add(wField);
            ccPane.add(ccPanel);
            ccPane.add(eField);
            ccPane.add(swField);
            ccPane.add(sField);
            ccPane.add(seField);
            // Begin Component Layout
            Insets paneInsets = ccPane.getInsets();
            Point P1 = new Point(0, 0);
            Point P2 = new Point(0, 0);
            Point P3 = new Point(0, 0);
            Dimension size = frameTitle.getPreferredSize();
            frameTitle.setBounds((5 + paneInsets.left), (5 + paneInsets.top), size.width, size.height);
            P1.setLocation((5 + paneInsets.left), (5 + paneInsets.top + size.height + 5));
            P2.setLocation((P1.x + size.width + 5), (paneInsets.top + 5));
            size = closeButton.getPreferredSize();
            closeButton.setBounds(P2.x, P2.y, size.width, size.height);
            frameSeparator1.setBounds(P1.x, P1.y, (panelDim.width - paneInsets.left - paneInsets.right), 10);
            P1.setLocation(P1.x, (P1.y + 10 + 5));
            P2.setLocation((P1.x + 50 + 75), P1.y);
            P3.setLocation((P1.x + 50 + 75 + 60 + 75), P1.y);
            nwField.setBounds(P1.x, P1.y, 50, 26);
            hdgSpinner.setBounds(P2.x, P2.y, 60, 26);
            neField.setBounds(P3.x, P3.y, 50, 26);
            P2.setLocation((P1.x + 50 + 5), (P1.y + 26 + 5));
            P1.setLocation(P1.x, (P1.y + 26 + 5 + 87));
            P3.setLocation((P1.x + 50 + 5 + 200 + 5), P1.y);
            wField.setBounds(P1.x, P1.y, 50, 26);
            ccPanel.setBounds(P2.x, P2.y, 200, 200);
            ccPanelPoint = new Point(P2.x, P2.y);
            eField.setBounds(P3.x, P3.y, 50, 26);
            P1.setLocation(P1.x, (P1.y + 26 + 87 + 5));
            P2.setLocation((P1.x + 50 + 80), P1.y);
            P3.setLocation((P1.x + 50 + 80 + 50 + 80), P1.y);
            swField.setBounds(P1.x, P1.y, 50, 26);
            sField.setBounds(P2.x, P2.y, 50, 26);
            seField.setBounds(P3.x, P3.y, 50, 26);
            // End with Frame sizing
            Dimension frameDim = new Dimension((paneInsets.left + 5 + 50 + 5 + 200 + 5 + 50 + 5 + paneInsets.right + 10), (P1.y + 26 + 5 + paneInsets.bottom + 40));
            this.setPreferredSize(frameDim);
            this.setSize(frameDim);
            //this.setSize((paneInsets.left + 5 + 50 + 5 + 200 + 5 + 50 + 5 + paneInsets.right), (P1.y + 26 + 5 + paneInsets.bottom));
        private void closeButtonActionPerformed(java.awt.event.ActionEvent evt)
            this.dispose();
        private void hdgSpinnerStateChanged(javax.swing.event.ChangeEvent evt)
            calculateAndDraw();
        private void calculateAndDraw()
            int angle = (Integer)hdgSpinner.getValue();
            int[] headings = new int[7];
            int addAngle = 45;
            for (int i = 0; i < 7; i++)
                headings[i] = angle + addAngle;
                if (headings[i] >= 360)
                    headings[i] -= 360;
                addAngle += 45;
            neField.setText(String.valueOf(headings[0]));
            eField.setText(String.valueOf(headings[1]));
            seField.setText(String.valueOf(headings[2]));
            sField.setText(String.valueOf(headings[3]));
            swField.setText(String.valueOf(headings[4]));
            wField.setText(String.valueOf(headings[5]));
            nwField.setText(String.valueOf(headings[6]));
            ccPanel.paintComponent(this.getGraphics(), angle);
            ccPanel.setBounds(ccPanelPoint.x, ccPanelPoint.y, 200, 200);
            //ccPanel.repaint(this.getGraphics(), angle);
    }The CompassCalculatorPanel.java code:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package com.vikingvirtual.flightsim;
    import java.awt.BasicStroke;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Point;
    import java.awt.Stroke;
    * @author madViking
    public class CompassCalculatorPanel extends javax.swing.JPanel
        private int xCent;
        private int yCent;
        public CompassCalculatorPanel()
            super();
        @Override
        public void paintComponent(Graphics g)
            paintComponent(g, 0);
        public void repaint(Graphics g, int angle)
            paintComponent(g, angle);
        public void paintComponent(Graphics g, int angle)
            super.paintComponent(g);
            Dimension panelDim = this.getSize();
            xCent = (panelDim.width / 2);
            yCent = (panelDim.height / 2);
            float[] dashArray = {8.0f};
            Graphics2D g2D = (Graphics2D)g;
            g2D.setColor(new Color(53, 153, 0));
            g2D.fillRect(0, 0, panelDim.width, panelDim.height);
            BasicStroke hdgLine = new BasicStroke(3.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER);
            BasicStroke northLine = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 10.0f, dashArray, 0.0f);
            Stroke stdStroke = g2D.getStroke();
            // Setup Heading Arrow Points
            Point hdgBottom = new Point(xCent, panelDim.height - 15);
            Point hdgTop = new Point(xCent, 15);
            Point ltHdgArr = new Point(xCent - 10, 20);
            Point rtHdgArr = new Point(xCent + 10, 20);
            // Setup North Arrow Points
            Point nthBottom = new Point(xCent, panelDim.height - 15);
            Point nthTop = new Point(xCent, 15);
            Point ltNthArr = new Point(xCent - 8, 20);
            Point rtNthArr = new Point(xCent + 8, 20);
            // Rotate North Arrow Points
            nthBottom = rotatePoint(nthBottom, (0 - angle), true);
            nthTop = rotatePoint(nthTop, (0 - angle), true);
            ltNthArr = rotatePoint(ltNthArr, (0 - angle), true);
            rtNthArr = rotatePoint(rtNthArr, (0 - angle), true);
            // Draw Heading Line
            g2D.setColor(Color.RED);
            g2D.setStroke(hdgLine);
            g2D.drawLine(hdgBottom.x, hdgBottom.y, hdgTop.x, hdgTop.y);
            g2D.drawLine(ltHdgArr.x, ltHdgArr.y, hdgTop.x, hdgTop.y);
            g2D.drawLine(rtHdgArr.x, rtHdgArr.y, hdgTop.x, hdgTop.y);
            g2D.setStroke(stdStroke);
            // Draw North Line
            g2D.setColor(Color.WHITE);
            g2D.setStroke(northLine);
            g2D.drawLine(nthBottom.x, nthBottom.y, nthTop.x, nthTop.y);
            g2D.drawLine(ltNthArr.x, ltNthArr.y, nthTop.x, nthTop.y);
            g2D.drawLine(rtNthArr.x, rtNthArr.y, nthTop.x, nthTop.y);
            g2D.setStroke(stdStroke);
            // Draw circles
            g2D.setColor(Color.BLUE);
            g2D.setStroke(hdgLine);
            g2D.drawOval(5, 5, (panelDim.width - 10), (panelDim.height - 10));
            g2D.setStroke(stdStroke);
            g2D.fillOval((xCent - 2), (yCent - 2), 5, 5);
            g2D.setStroke(stdStroke);
        private Point rotatePoint(Point p, int angle, boolean centerRelative)
            double ix, iy;
            double hyp = 0.0;
            double degrees = 0.0;
            if (centerRelative == true)
                ix = (double)(p.x - xCent);
                iy = (double)((p.y - yCent)*-1);
            else
                ix = (double)p.x;
                iy = (double)p.y;
            if (ix == 0)
                ix = 1;
            hyp = Math.sqrt((Math.pow(ix, 2)) + (Math.pow(iy, 2)));
            if ((ix >= 0) && (iy >= 0))
                degrees = Math.toDegrees(Math.atan(ix/iy));
            else if((ix >= 0) && (iy < 0))
                degrees = Math.abs(Math.toDegrees(Math.atan(iy/ix)));
                degrees = degrees + 90.0;
            else if ((ix < 0) && (iy < 0))
                degrees = Math.toDegrees(Math.atan(ix/iy));
                degrees = degrees + 180.0;
            else if ((ix < 0) && (iy >= 0))
                degrees = Math.abs(Math.toDegrees(Math.atan(iy/ix)));
                degrees = degrees + 270.0;
            degrees = degrees + angle;
            if (degrees >= 360)
                degrees = degrees - 360;
            if (degrees < 0)
                degrees = degrees + 360;
            double interX = Math.sin(Math.toRadians(degrees));
            double interY = Math.cos(Math.toRadians(degrees));
            interX = interX * hyp;
            interY = ((interY * hyp) * -1);
            if (centerRelative == true)
                p.x = xCent + (int)Math.floor(interX);
                p.y = yCent + (int)Math.floor(interY);
            else
                p.x = (int)Math.floor(interX);
                p.y = (int)Math.floor(interY);
            return p;
    }

    In response to the first couple of comments made about using Absolute positioning (layout null), I took a look at the page on doing layouts, which happens to be the link you sent. I read about each, and decided that a GridBag layout would be best. So I created a new class called CompassCalcGridBagFrame and set it all up using the same components, but with a Grid Bag layout. I encounter the exact same problem.
    Just FYI: I originally created this frame using the NetBeans (6.9.1) Frame form builder. By default that uses the Free Design setting, which creates group layouts for both vertical and horizontal spacing. This is where the problem first came to be. I next used the builder to create an absolute positioning frame, which had the same issue. That is when I started building my frames using code only - no NetBeans GUIs. This is where the absolute layout from scratch code started. Same effect. And now, I've created a Grid Bag layout from code, and same effect. There has to be something I'm missing overall, as this effects all of my different layout designs.
    The one thing from gimbal2's previous comment is, should I be using this custom panel within another panel? I am currently adding all of the components (and in Grid Bag, the GridBag layout) to the frame pane itself. Is that OK, or should I use a generic JPanel, and have the components all within that?
    Here is the code for the newest frame class (CompassCalcGridBagFrame):
    package com.vikingvirtual.flightsim;
    import java.awt.Color;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.Point;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JSeparator;
    import javax.swing.JSpinner;
    import javax.swing.JTextField;
    * @author madViking
    public class CompassCalcGridBagFrame extends JFrame
        private CompassCalculatorPanel ccPanel;
        private JButton closeButton;
        private JLabel frameTitle;
        private JSeparator frameSeparator1;
        private JSpinner hdgSpinner;
        private JTextField neField;
        private JTextField eField;
        private JTextField seField;
        private JTextField sField;
        private JTextField swField;
        private JTextField wField;
        private JTextField nwField;
        private Point ccPanelPoint;
        public CompassCalcGridBagFrame()
            super ("Compass Heading Calculator");
            initComponents();
            this.pack();
            this.setVisible(true);
            calculateAndDraw();
        private void initComponents()
            this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            Container ccPane = this.getContentPane();
            ccPane.setLayout(new GridBagLayout());
            ccPane.setBackground(Color.BLACK);
            ccPane.setForeground(Color.BLACK);
            Font buttonFont = new Font("Tahoma", 1, 12);
            Font compassFont = new Font("Digital-7", 0, 24);
            Font titleFont = new Font("Lucida Sans", 1, 14);
            frameTitle = new JLabel();
            frameTitle.setText("Compass Heading Calculator");
            frameTitle.setFont(titleFont);
            frameTitle.setHorizontalAlignment(JLabel.CENTER);
            frameTitle.setPreferredSize(new Dimension(220, 25));
            frameTitle.setForeground(Color.BLACK);
            closeButton = new JButton();
            closeButton.setText("Close");
            closeButton.setToolTipText("Click to close view");
            closeButton.setFont(buttonFont);
            closeButton.setPreferredSize(new Dimension(75, 25));
            closeButton.addActionListener(new java.awt.event.ActionListener() {public void actionPerformed(java.awt.event.ActionEvent evt)
                                                                              {closeButtonActionPerformed(evt);}});
            hdgSpinner = new JSpinner();
            hdgSpinner.setFont(compassFont);
            hdgSpinner.setModel(new javax.swing.SpinnerNumberModel(0, -1, 360, 1));
            hdgSpinner.setToolTipText("Enter heading to see angles change");
            hdgSpinner.setPreferredSize(new Dimension(50, 26));
            hdgSpinner.addChangeListener(new javax.swing.event.ChangeListener() {public void stateChanged(javax.swing.event.ChangeEvent evt)
                                                                                {hdgSpinnerStateChanged(evt);}});
            neField = new JTextField();
            neField.setBackground(Color.BLACK);
            neField.setEditable(false);
            neField.setFont(compassFont);
            neField.setForeground(Color.WHITE);
            neField.setHorizontalAlignment(JTextField.CENTER);
            neField.setPreferredSize(new Dimension(50, 26));
            neField.setBorder(null);
            eField = new JTextField();
            eField.setBackground(Color.BLACK);
            eField.setEditable(false);
            eField.setFont(compassFont);
            eField.setForeground(Color.WHITE);
            eField.setHorizontalAlignment(JTextField.CENTER);
            eField.setPreferredSize(new Dimension(50, 26));
            eField.setBorder(null);
            seField = new JTextField();
            seField.setBackground(Color.BLACK);
            seField.setEditable(false);
            seField.setFont(compassFont);
            seField.setForeground(Color.WHITE);
            seField.setHorizontalAlignment(JTextField.CENTER);
            seField.setPreferredSize(new Dimension(50, 26));
            seField.setBorder(null);
            sField = new JTextField();
            sField.setBackground(Color.BLACK);
            sField.setEditable(false);
            sField.setFont(compassFont);
            sField.setForeground(Color.WHITE);
            sField.setHorizontalAlignment(JTextField.CENTER);
            sField.setPreferredSize(new Dimension(50, 26));
            sField.setBorder(null);
            swField = new JTextField();
            swField.setBackground(Color.BLACK);
            swField.setEditable(false);
            swField.setFont(compassFont);
            swField.setForeground(Color.WHITE);
            swField.setHorizontalAlignment(JTextField.CENTER);
            swField.setPreferredSize(new Dimension(50, 26));
            swField.setBorder(null);
            wField = new JTextField();
            wField.setBackground(Color.BLACK);
            wField.setEditable(false);
            wField.setFont(compassFont);
            wField.setForeground(Color.WHITE);
            wField.setHorizontalAlignment(JTextField.CENTER);
            wField.setPreferredSize(new Dimension(50, 26));
            wField.setBorder(null);
            nwField = new JTextField();
            nwField.setBackground(Color.BLACK);
            nwField.setEditable(false);
            nwField.setFont(compassFont);
            nwField.setForeground(Color.WHITE);
            nwField.setHorizontalAlignment(JTextField.CENTER);
            nwField.setPreferredSize(new Dimension(50, 26));
            nwField.setBorder(null);
            frameSeparator1 = new JSeparator();
            frameSeparator1.setForeground(Color.WHITE);
            frameSeparator1.setBackground(Color.BLACK);
            frameSeparator1.setPreferredSize(new Dimension(320, 10));
            ccPanel = new CompassCalculatorPanel();
            ccPanel.setPreferredSize(new Dimension(250, 250));
            GridBagConstraints gbc = new GridBagConstraints();
            // Begin Component Layout
            gbc.insets = new Insets(0, 0, 0, 0);
            gbc.fill = GridBagConstraints.NONE;
            gbc.gridx = 0;
            gbc.gridy = 0;
            gbc.gridwidth = 1;
            gbc.gridheight = 1;
            gbc.weightx = 0.5;
            gbc.weighty = 0.5;
            gbc.anchor = GridBagConstraints.FIRST_LINE_START;
            ccPane.add(nwField, gbc);
            gbc.gridx = 1;
            gbc.gridy = 0;
            gbc.gridwidth = 2;
            gbc.gridheight = 1;
            gbc.weightx = 0.4;
            gbc.weighty = 0.4;
            gbc.anchor = GridBagConstraints.PAGE_START;
            ccPane.add(hdgSpinner, gbc);
            gbc.gridx = 3;
            gbc.gridy = 0;
            gbc.gridwidth = 1;
            gbc.gridheight = 1;
            gbc.weightx = 0.5;
            gbc.weighty = 0.5;
            gbc.anchor = GridBagConstraints.FIRST_LINE_END;
            ccPane.add(neField, gbc);
            gbc.gridx = 0;
            gbc.gridy = 1;
            gbc.gridwidth = 1;
            gbc.gridheight = 1;
            gbc.weightx = 0.5;
            gbc.weighty = 0.5;
            gbc.anchor = GridBagConstraints.LINE_START;
            ccPane.add(wField, gbc);
            gbc.gridx = 1;
            gbc.gridy = 1;
            gbc.gridwidth = 2;
            gbc.gridheight = 1;
            gbc.weightx = 1.0;
            gbc.weighty = 1.0;
            gbc.anchor = GridBagConstraints.CENTER;
            ccPane.add(ccPanel, gbc);
            gbc.gridx = 3;
            gbc.gridy = 1;
            gbc.gridwidth = 1;
            gbc.gridheight = 1;
            gbc.weightx = 0.5;
            gbc.weighty = 0.5;
            gbc.anchor = GridBagConstraints.LINE_END;
            ccPane.add(eField, gbc);
            gbc.gridx = 0;
            gbc.gridy = 2;
            gbc.gridwidth = 1;
            gbc.gridheight = 1;
            gbc.weightx = 0.5;
            gbc.weighty = 0.5;
            gbc.anchor = GridBagConstraints.LAST_LINE_START;
            ccPane.add(swField, gbc);
            gbc.gridx = 1;
            gbc.gridy = 2;
            gbc.gridwidth = 2;
            gbc.gridheight = 1;
            gbc.weightx = 0.5;
            gbc.weighty = 0.5;
            gbc.anchor = GridBagConstraints.PAGE_END;
            ccPane.add(sField, gbc);
            gbc.gridx = 3;
            gbc.gridy = 2;
            gbc.gridwidth = 1;
            gbc.gridheight = 1;
            gbc.weightx = 0.5;
            gbc.weighty = 0.5;
            gbc.anchor = GridBagConstraints.LAST_LINE_END;
            ccPane.add(seField, gbc);
            gbc.gridx = 0;
            gbc.gridy = 3;
            gbc.gridwidth = 4;
            gbc.gridheight = 1;
            gbc.insets = new Insets(10, 5, 10, 5);
            gbc.weightx = 0.6;
            gbc.weighty = 0.6;
            gbc.anchor = GridBagConstraints.CENTER;
            ccPane.add(frameSeparator1, gbc);
            gbc.gridx = 1;
            gbc.gridy = 4;
            gbc.gridwidth = 2;
            gbc.gridheight = 1;
            gbc.anchor = GridBagConstraints.PAGE_START;
            ccPane.add(closeButton, gbc);
        private void closeButtonActionPerformed(java.awt.event.ActionEvent evt)
            this.dispose();
        private void hdgSpinnerStateChanged(javax.swing.event.ChangeEvent evt)
            calculateAndDraw();
        private void calculateAndDraw()
            int angle = (Integer)hdgSpinner.getValue();
            if (angle == -1)
                angle = 359;
            if (angle == 360)
                angle = 0;
            int[] headings = new int[7];
            int addAngle = 45;
            for (int i = 0; i < 7; i++)
                headings[i] = angle + addAngle;
                if (headings[i] >= 360)
                    headings[i] -= 360;
                addAngle += 45;
            hdgSpinner.setValue(Integer.valueOf(angle));
            neField.setText(String.valueOf(headings[0]));
            eField.setText(String.valueOf(headings[1]));
            seField.setText(String.valueOf(headings[2]));
            sField.setText(String.valueOf(headings[3]));
            swField.setText(String.valueOf(headings[4]));
            wField.setText(String.valueOf(headings[5]));
            nwField.setText(String.valueOf(headings[6]));
            ccPanel.paintComponent(this.getGraphics(), angle);
    }

  • HTML Component Palette

    Is there a standard HTML component palette that is part of Studio Creator? If so, how do I add it to my list of component palettes so I can visually design the HTML portions of my page.

    I don't remember the exact reasons of why it's bad to mix the two. But consider a data table for example. It renders its own children components -- let's say the UIColumns. It won't try to render all the markup tags (that are not JSF components obviously) that may appear between the ui column tags in the source. There's some kind of buffering issue too, but I really don't have a lot of information on this. The other issue is of course what I wrote in my blog -- that once you go to markup instead of logical jsf components you lose the ability to have the presentation dynamically altered by the server at runtime, to for example adapt to different kinds of browsers, or even user selected themes.
    This of course is a balance against the ability to have a specific custom-tweaked look for your page created using tools like Dreamweaver.
    -- Tor
    http://blogs.sun.com/tor

  • How to add custom field in delivery address/performance location tab in SRM shopping cart and Ship to address Pop-up in SRM PO?

    Hi Experts
    i have a reuirement where i have to add custom field in delivery address/performance location tab in SRM shopping cart and Ship to address Pop-up in SRM PO
    i am doing below steps for this.
    1. Adding custom field ZZfield in structure INCL_EEW_PD_PARTNER_CSF by  using  append structure.
    2. Spro ->Supplier Relationship Management -> SRM Server -> Cross application basic settings -> Extensions and field controls (personalization) -> Configure field control ->Configure Control for Fields of Substructures
    then click on  "Metadata for Fields of Substructures and Table-Like Enhancements"  
    add the below entry
    Bus. Object Set Type  : I am trying 7 and 29
    Structure Field Name  : ZZfield
    Bus. Object Type       : BUS2121/BUS2201
    Set Level                    : Item
    Field Visible :  Check box should be checked
    Field Enable :  check box should be checked
    Can anyone has the idea of this?
    Thanks
    Rohit

    Hello Rohit,
    Please create a enchancement for component  /SAPSRM/WDC_UI_DO_SHIPTO.
    Add new input field and label in view V_DODC_SHIPTO.
    Bind the input field value with field ZZfield from structure  /SAPSRM/WDC_UI_DO_SHIPTO in the context node SHIP_TO .
    Regards,
    Neelima

  • Is it possible to add a JPanel to JScrollPane

    i created a JPanel .
    I gave the layout for this panel to be NULL .
    Then i added 16 JLabels in that JPanel(using setbounds)
    when i try to add it to the container i was not able to see last two labels
    So i tried to create a JscrollPane and i add that JPanel to this JScrollPane
    I cant see any difference and the JScrollPane was not working
    The code is:
    JScrollPane scrollPane = new JScrollPane(p);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(scrollPane,BorderLayout.CENTER);
    I dont know
    1) Is it correct to add a JPanel to JScrollPane
    2)Is it compulsory to use a Layout style while using JScrollPane

    i created a JPanel .
    I gave the layout for this panel to be NULL .
    Then i added 16 JLabels in that JPanel(using
    setbounds)
    when i try to add it to the container i was not able
    to see last two labelswhich container ?
    Have you checked that the size of this container is coherent
    with the one of your JPanel ?
    And even before, can this container let the JPanel take the size needed for the
    16 JLabels ?
    So i tried to create a JscrollPane and i add that
    JPanel to this JScrollPane
    I cant see any difference and the JScrollPane was not
    working
    The code is:
    JScrollPane scrollPane = new JScrollPane(p);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(scrollPane,BorderLayout.CENTER);
    I dont know
    1) Is it correct to add a JPanel to JScrollPaneyes
    2)Is it compulsory to use a Layout style while using
    JScrollPaneJScrollPane has it own layout.
    However the component/container you whish to view with the JScrollPane
    can have the Layout you whish.

Maybe you are looking for