Align with component in another panel

ok, I have two panels with a checkbox and a textfield in each. I want the respective checkboxes to be aligned and also the textfields with eachother.
another question is if I can set the background of a JTextArea if it doesn't have a name, I've just added it to a panel with
panel.add(new JTextArea("hello my friend");
greatful for advice
love/m

no, I can use any layout that helps me get the result I want!
right now, I've chosen another solution, but I still would like ideas on alignment since the new design includes four panels with different contents. I wants the four panels to have the same size (oh, they need to be in individual panels since they all have different borders) so I've used gridlayout. but now the component JTextField grows to an ugly size trying to fill the flippin' panel.
does this make sense? I hope you understand what I mean.
best regards/m

Similar Messages

  • Right alignment with in navigation panel.....

    Hi, I am new to JSF. I am using this tag, i want the text to be right aligned with in this navigation panel.
    But, it is not working. Please guide me to align the text on right hand side.
    I am using JSF 1.2 version and Tomcat 6.0
    <t:panelNavigation2 align="right">Please help me.
    Regards,
    ash

    Use CSS along with the styleClass and/or style attributes.

  • How to merge the Panel with another Panel to One Panel?

    As Title!!

    i will give it a shot. by no means do i say it is correct being a beginner myself
    Panel aPanel = new Panel();
    Panel anotherPanel = new Panel();
    Panel mythirdPanel = new Panel();
    aPanel.add(anotherPanel);
    aPanel.add(myThirdPanel);
    this should create one panel called aPanel with two panels inside - another Panel first, followed by mythirdPanel second. This should be in FlowLayout pattern as that is default unless specified.
    That is my guess and my shot.
    8)

  • Clicking on one LinkID i want to refresh another panel group layout compone

    Hello ,
    i want to refresh a component situated on same jsf page by clicking on linkID component in another fragment how to do it

    i want to refresh PanelFormLayout whose ID is pnlReg
    when i was trying to implement this code in bean class
    FacesContext vFacesContext=FacesContext.getCurrentInstance();
    UIViewRoot vUIViewRoot=vFacesContext.getViewRoot();
    UIComponent vTheInputFileComponent;
    vTheInputFileComponent = vUIViewRoot.findComponent("pnlReg");
    AdfFacesContext.getCurrentInstance().addPartialTarget(vTheInputFileComponent);
    i was getting this error
    UIComponent is null
    ADF_FACES-60101:For more information, please see the portlets error log for an entry beginning with: ADF_FACES-60096:Server Exception during PPR, #2
    Here is the Stack Trace
    javax.faces.el.EvaluationException: java.lang.NullPointerException: UIComponent is null
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:148)
         at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:241)
         at oracle.adf.view.rich.component.rich.data.RichTree.broadcast(RichTree.java:248)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
         at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:995)
         at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:1166)
         at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:706)
         at javax.portlet.faces.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:297)
         at oracle.portlet.bridge.adf.application.ADFBridgePortlet.serveResource(ADFBridgePortlet.java:176)
         at com.bea.portlet.container.PortletStub.doResource(PortletStub.java:1043)
         at com.bea.portlet.container.FilterChainGenerator.runFilterChain(FilterChainGenerator.java:141)
         at com.bea.portlet.container.PortletStub.renderResource(PortletStub.java:779)
         at com.bea.portlet.container.AppContainer.invokeResourceStub(AppContainer.java:1390)
         at com.bea.portlet.container.AppContainer.invokeResource(AppContainer.java:1342)
         at com.bea.wsrp.producer.adapter.javaportlet.JavaPortletAdapter.getResource(JavaPortletAdapter.java:694)
         at com.bea.wsrp.producer.handlers.markup.MarkupServiceHandler.doGetResource(MarkupServiceHandler.java:766)
         at com.bea.wsrp.producer.handlers.markup.MarkupServiceHandler.doService(MarkupServiceHandler.java:295)
         at com.bea.wsrp.producer.handlers.AbstractServiceHandler.service(AbstractServiceHandler.java:71)
         at com.bea.wsrp.producer.container.ProducerEndPoint.processNow(ProducerEndPoint.java:349)
         at com.bea.wsrp.producer.container.ProducerEndPoint.processNow(ProducerEndPoint.java:250)
         at com.bea.wsrp.producer.container.ProducerEndPoint.processNow(ProducerEndPoint.java:208)
         at oracle.portlet.server.adapter.web.WSRP_v2_Markup_PortTypeSoapToEndpoint.getResource(WSRP_v2_Markup_PortTypeSoapToEndpoint.java:128)
         at oasis.names.tc.wsrp.v2.bind.runtime.WSRP_v2_Markup_Binding_SOAP_Tie.invoke_getResource(WSRP_v2_Markup_Binding_SOAP_Tie.java:428)
         at oasis.names.tc.wsrp.v2.bind.runtime.WSRP_v2_Markup_Binding_SOAP_Tie.processingHook(WSRP_v2_Markup_Binding_SOAP_Tie.java:1451)
         at oracle.j2ee.ws.server.StreamingHandler.handle(StreamingHandler.java:299)
         at oracle.j2ee.ws.server.JAXRPCProcessor.doEndpointProcessing(JAXRPCProcessor.java:442)
         at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:1112)
         at oracle.j2ee.ws.server.JAXRPCProcessor.doRequestProcessing(JAXRPCProcessor.java:333)
         at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:233)
         at oracle.j2ee.ws.server.JAXRPCProcessor.doService(JAXRPCProcessor.java:185)
         at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:485)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.portlet.producer.container.endpoint.ProducerEndpointFilter.doFilter(ProducerEndpointFilter.java:36)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.NullPointerException: UIComponent is null
         at org.apache.myfaces.trinidad.component.UIXComponent.addPartialTarget(UIXComponent.java:498)
         at org.apache.myfaces.trinidadinternal.context.RequestContextImpl.addPartialTarget(RequestContextImpl.java:519)
         at oracle.adfinternal.view.faces.context.AdfFacesContextImpl.addPartialTarget(AdfFacesContextImpl.java:660)
         at com.impact.esopm.valueobjects.MainContentBean.linkID(MainContentBean.java:120)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         ... 80 more
    <XmlErrorHandler> <handleError> ADF_FACES-60096:Server Exception during PPR, #1
    javax.faces.el.EvaluationException: java.lang.NullPointerException: UIComponent is null
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at org.apache.myfaces.trinidad.component.UIXCollection.broadcast(UIXCollection.java:148)
         at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:241)
         at oracle.adf.view.rich.component.rich.data.RichTree.broadcast(RichTree.java:248)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
         at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRender(BridgeImpl.java:995)
         at org.apache.myfaces.portlet.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:1166)
         at javax.portlet.faces.GenericFacesPortlet.doBridgeDispatch(GenericFacesPortlet.java:706)
         at javax.portlet.faces.GenericFacesPortlet.serveResource(GenericFacesPortlet.java:297)
         at oracle.portlet.bridge.adf.application.ADFBridgePortlet.serveResource(ADFBridgePortlet.java:176)
         at com.bea.portlet.container.PortletStub.doResource(PortletStub.java:1043)
         at com.bea.portlet.container.FilterChainGenerator.runFilterChain(FilterChainGenerator.java:141)
         at com.bea.portlet.container.PortletStub.renderResource(PortletStub.java:779)
         at com.bea.portlet.container.AppContainer.invokeResourceStub(AppContainer.java:1390)
         at com.bea.portlet.container.AppContainer.invokeResource(AppContainer.java:1342)
         at com.bea.wsrp.producer.adapter.javaportlet.JavaPortletAdapter.getResource(JavaPortletAdapter.java:694)
         at com.bea.wsrp.producer.handlers.markup.MarkupServiceHandler.doGetResource(MarkupServiceHandler.java:766)
         at com.bea.wsrp.producer.handlers.markup.MarkupServiceHandler.doService(MarkupServiceHandler.java:295)
         at com.bea.wsrp.producer.handlers.AbstractServiceHandler.service(AbstractServiceHandler.java:71)
         at com.bea.wsrp.producer.container.ProducerEndPoint.processNow(ProducerEndPoint.java:349)
         at com.bea.wsrp.producer.container.ProducerEndPoint.processNow(ProducerEndPoint.java:250)
         at com.bea.wsrp.producer.container.ProducerEndPoint.processNow(ProducerEndPoint.java:208)
         at oracle.portlet.server.adapter.web.WSRP_v2_Markup_PortTypeSoapToEndpoint.getResource(WSRP_v2_Markup_PortTypeSoapToEndpoint.java:128)
         at oasis.names.tc.wsrp.v2.bind.runtime.WSRP_v2_Markup_Binding_SOAP_Tie.invoke_getResource(WSRP_v2_Markup_Binding_SOAP_Tie.java:428)
         at oasis.names.tc.wsrp.v2.bind.runtime.WSRP_v2_Markup_Binding_SOAP_Tie.processingHook(WSRP_v2_Markup_Binding_SOAP_Tie.java:1451)
         at oracle.j2ee.ws.server.StreamingHandler.handle(StreamingHandler.java:299)
         at oracle.j2ee.ws.server.JAXRPCProcessor.doEndpointProcessing(JAXRPCProcessor.java:442)
         at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:1112)
         at oracle.j2ee.ws.server.JAXRPCProcessor.doRequestProcessing(JAXRPCProcessor.java:333)
         at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:233)
         at oracle.j2ee.ws.server.JAXRPCProcessor.doService(JAXRPCProcessor.java:185)
         at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:485)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.portlet.producer.container.endpoint.ProducerEndpointFilter.doFilter(ProducerEndpointFilter.java:36)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.NullPointerException: UIComponent is null
         at org.apache.myfaces.trinidad.component.UIXComponent.addPartialTarget(UIXComponent.java:498)
         at org.apache.myfaces.trinidadinternal.context.RequestContextImpl.addPartialTarget(RequestContextImpl.java:519)
         at oracle.adfinternal.view.faces.context.AdfFacesContextImpl.addPartialTarget(AdfFacesContextImpl.java:660)
         at com.impact.esopm.valueobjects.MainContentBean.linkID(MainContentBean.java:120)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         ... 80 more
    Edited by: Mayur Mitkari on Aug 13, 2012 4:43 AM

  • How to use another panels in status line

    Hi Everyone:
    Can anybody tell me how can i use another panels in the
    Console's status line, I'm using the message line but i need to
    show the user's name and Date-Tiem in another section of the
    status line and not in display controls as i'm already doing it.
    Thanks.

    Do you really need a JSF component for that? You can use h:panelGroup and some JS. But a simple div with some JS is also sufficient.

  • JPanel not repainting if embedded in another panel

    I have a reusable class called as DuplicatorPanel. This class has two add/ remove buttons like in Mac if you are familiar.
    The problem is that the screen gets updated with an extra row in case i have a main method in Duplicator itself. However if i have that in another panel as in HyperlinkBuilder then it does not repaint itself.
    Please can someone help ?
    package sam.dnd;
    import java.awt.event.ActionEvent;
    import java.util.Iterator;
    import java.util.LinkedHashMap;
    import java.util.Map;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    public abstract class DuplicatorPanel extends Box {
        private static final long serialVersionUID = 1L;
        private static int oneup = 0;
        private Map<String, JComponent> panelMap = new LinkedHashMap<String, JComponent>();
        private Action addAction;
        private Action removeAction;
        public DuplicatorPanel() {
            super(BoxLayout.Y_AXIS);
            this.initComponents();
            this.placeComponents();
        private void initComponents() {
            addAction = new AddAction();
            removeAction = new RemoveAction();
            addDuplicatorPanel();
        private void placeComponents() {
            Iterator<JComponent> itr = this.panelMap.values().iterator();
            while(itr.hasNext()) {
                JComponent comp = (JComponent) itr.next();
                this.add(comp);
            this.add(Box.createVerticalGlue());
        private void addDuplicatorPanel() {
            int index = oneup++;
            JComponent component = this.createDuplicate();
            JButton btnAdd = new JButton("Add");
            btnAdd.setActionCommand("" + index);
            btnAdd.addActionListener(this.addAction);
            JButton btnRemove = new JButton("Remove");
            btnRemove.setActionCommand("" + index);
            btnRemove.addActionListener(this.removeAction);
            Box box = Box.createHorizontalBox();
            box.add(component);
            box.add(Box.createHorizontalGlue());
            box.add(btnAdd);
            box.add(btnRemove);
            this.panelMap.put("" + index, box);
            fireValueChanged();
        private void fireValueChanged() {
            this.removeAll();
            this.placeComponents();
            this.repaint();
        protected void doAdd() {
            addDuplicatorPanel();
            fireValueChanged();
        protected void doRemove(String key) {
            if(this.panelMap.size() == 1) {
                return;
            JComponent comp = this.panelMap.remove(key);
            if(comp != null) {
                this.fireValueChanged();
        protected abstract JComponent createDuplicate();
        class AddAction extends AbstractAction {
            private static final long serialVersionUID = 1L;
            public void actionPerformed(ActionEvent evt) {
                doAdd();
        class RemoveAction extends AbstractAction {
            private static final long serialVersionUID = 1L;
            public void actionPerformed(ActionEvent evt) {
                JButton source = (JButton) evt.getSource();
                doRemove(source.getActionCommand());
         * @param args
        public static void main(String[] args) {
            JFrame f = new JFrame();
            f.add(new MyDuplicatorPanel());
            f.setSize(200, 200);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setVisible(true);
        static class MyDuplicatorPanel extends DuplicatorPanel {
            private static final long serialVersionUID = 1L;
            public JComponent createDuplicate() {
                return new JLabel("Test");
    }This is another class that calls the above
    package sam.dnd;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.event.ItemEvent;
    import java.awt.event.ItemListener;
    import java.util.HashMap;
    import javax.swing.JComboBox;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    public class HyperLinkBuilder extends JPanel {
        private static final long serialVersionUID = 1L;
         * @param args
        public static void main(String[] args) {
            JFrame f = new JFrame();
            f.add(new HyperLinkBuilder());
            f.setSize(200, 200);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setVisible(true);
        private static HashMap<String, String> linkNameValueMap = new HashMap<String, String>();
        private static HashMap<String, String> paramNameValueMap = new HashMap<String, String>();
        private static HashMap<String, String> valueNameValueMap = new HashMap<String, String>();
        static {
            linkNameValueMap.put("Name1", "Value1");
            linkNameValueMap.put("Name2", "Value2");
            linkNameValueMap.put("Name3", "Value3");
            paramNameValueMap.put("Name1", "Value1");
            paramNameValueMap.put("Name2", "Value2");
            paramNameValueMap.put("Name3", "Value3");
            valueNameValueMap.put("Name1", "Value1");
            valueNameValueMap.put("Name2", "Value2");
            valueNameValueMap.put("Name3", "Value3");
        private String link;
        private JComboBox linkCombo;
        private DuplicatorPanel panel;
        public HyperLinkBuilder() {
            this.initComponents();
            this.placeComponents();
            this.addListeners();
        private void initComponents() {
            linkCombo = new JComboBox(linkNameValueMap.keySet().toArray());
            panel = new MyDuplicatorPanel();
        private void placeComponents() {
            this.setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.gridx = 0;
            gbc.gridy = 0;
            this.add(linkCombo, gbc);
            gbc.gridy++;
            gbc.fill = GridBagConstraints.BOTH;
            this.add(panel, gbc);
        private void addListeners() {
            this.linkCombo.addItemListener(new LinkSelector());
        private JPanel createNameValuePanel() {
            JComboBox nameCombo = new JComboBox(paramNameValueMap.keySet().toArray());
            JComboBox valueCombo = new JComboBox(valueNameValueMap.keySet().toArray());
            JPanel panel = new JPanel();
            panel.add(nameCombo);
            panel.add(valueCombo);
            return panel;
        private void doLinkSelected() {
            String name = (String) linkCombo.getSelectedItem();
            link = linkNameValueMap.get(name);
        public String build() {
            //TODO:
            return this.link;
        class LinkSelector implements ItemListener {
            public void itemStateChanged(ItemEvent e) {
                doLinkSelected();
        class MyDuplicatorPanel extends DuplicatorPanel {
            private static final long serialVersionUID = 1L;
            @Override
            protected JComponent createDuplicate() {
                return HyperLinkBuilder.this.createNameValuePanel();
    }

    Hey Xeon,
    Replace that repaint() with revalidate. That is the trick in there.
    -Sam

  • Check a checkbox in a jtable in a panel from another panel

    I have a panel-> Panel A
    where I have some conditions and on that condition I want to check a checkbox in a jtable in another panel ->PanelB
    So Panel B has a jtable with one column as checkbox,I want to check/uncheck this checkbox based on some conditions in some other panel A
    I have no idea how to do this.Please help.
    Thanks

    885522 wrote:
    How will the change be reflected dynamically if the value changes in some other panel.By code that you write. If you want component X to change based on some changes to component Y, then first you set up a listener which will notify you when changes to component Y take place. In that listener you put code which makes the appropriate changes to component X, based on what happened to component Y.

  • Replace a component by another in a Frame

    Hi all!
    I've a frame with several component (panels, buttons...) set with a gridbaglayout.
    I would like to know if i could replace a component by another.
    For instance.
    Frame f = new Frame();
    button b1 = new button("b1");
    panel p = new panel()....
    f.add(b1)
    /* replace b1 by p
    like :
    f.remove(b1);
    f.add(p);
    */Thanks!

    Sure, you can replace any component by enother one.
    add f.validate() in the end.

  • Form Guide - Populating a drop down with entries from another field(s)

    Greetings all!
    Here is what I am trying to accomplish:
    1. Build a repeating panel that has a field for the entry of a Name. (I can do this)
    2. Build a drop down field on another panel that will be populated with the Name entries from one or more of the repeating panel Name fields in 1. above. I would like this to happen while the user is in the same render of the form guide.
    3. Setup:
         LC ES2
         Workbench 9.5
         Would utilize Workspace to complete the form guide
         Want to use a .fml data model
    Any help would be appreciated.
    Best Regards,
    Rick Kuhlmann

    pguerett,
    Many thanks for that lca. I have been able to move forward with development of a POC Form Guide.
    However, I have one other issue that if solved will push my POC to the point of demo status for the business.
    Here it is:
    The business needs to be able to add the names of children to a Children Info panel on the form guide. - No problems with that.
    Then they need to be able to go to another panel in the form guide and select a child name from a drop down to associate that child with the name of a father. - The previous post with the lca solved that.
    Now what I need to do is to be able to take the selected child in the father panel and place that value into the data model.
    Why? because the final part of this form guide is to populate a pdf form that is really a legal petition to the court. The child(ren) names form the Children Info panel are listed at the beginning of the petition. Then the selected child in the father panel is displayed in the father section.
    So what I am looking to do is to populate that selected child in the father panel to a property in the data model.
    However, based on the lca you sent it does not seem that when I add a Data Object to the Data Model in the Guide Builder that I am not able to push that data back into the original Data Model. I thought that using a Binding might work but I have struck out so far.
    Clear as mud? Any help you or anyone else can provide would be wonderful.
    Thanks a ton!
    Rick Kuhlmann

  • Displaying thumbnail images in another panel when it  mouse clicked

    hi,
    I am using JAI, what i am trying to do is i am decoding the tiff file and creating thumbnail of that images and adding thumbnail images to one panel and enlarged images to another panel using DisplayJAI. Now when i will click i thumbnail images on left panel then that image should be display to another panel on right side. Adding both panel to JSplit panel.
    I have no idia how to do it, i tried to do in different way but not able to do that. I hope anybody can give me the hints about this.
    Thanks

    i am adding thumbnail of all images in left panel and enlarged view of each thumbnail is added in right panel , and what i require that when i click thumbnail in left side it's corresponding enlarged image should be visible, suppose in right panel page no. 1 is visible and when i click thumbnail of 13 page in left panel that should be in viewport of right panel.You should put your right panel inside a JScrollPane and call [scrollRectToVisible() |http://java.sun.com/javase/6/docs/api/javax/swing/JComponent.html#scrollRectToVisible(java.awt.Rectangle)] from your panel. You can put the rectangles corresponding to enlarged images in a hash map with the keys being some unique attribute of your thumbnails in left panel. That will help in getting the rectangle to make visible, real fast. Or, you can just put the rectangles in some array indexed according to the thumbnails in left panel.
    I also want to hide the left panel, i think it's possible by Frame.Yes it is possible, but you said you have both your panels in a split pane, so maybe you can use its setDividerLocation() function to hide your left panel.
    Thanks!

  • How can I make numbers align with the baseline in ordered lists with inline images?

    When I use inline images in an ordered list, the number for every line that has an inline image is offset from the baseline to align with the top of the image. Here is a screen shot from Preview mode (same behavior on real devices):
    List entries 1 and 3 are normal. Entries 2 and 4, which contain inline images, have their numbers offset above the baseline.
    I guess the line-height gets redefined based on the inline image, and then the numbers align based on line-height. Is there a way to change this within Muse so the numbers will consistently sit at the baseline even when the line includes an image? Is it something that needs to be addressed by modifying style sheets?

    Hi,
    You are correct in observing that inline objects affect line height, which in turn affects alignment of the bullet/number with the line.
    To address this, you can use negative wrap offsets on the inline (specifically top offset) using the Wrap panel: adjust the value until the inline no longer adversely affects line height.
    Hope this helps.
    Abhishek

  • Add a panel on another panel

    I am working on a program and need to put one panel into another panel . I have been successful at adding the panel
    however when i do this i cannot set the size of the 2nd panel. The first panel on the frame is just fine
    i have tried adding the panel to the first panels constructor this works the panel shows up but i am unable
    to set the size of the panel which is the problem.
    I tried calling this.setSize in the second panels constructor to solve this problem no luck there
    i have also tried adding the 2nd panel to the frame but this produces the same problem as stated above
    im really stumped any help woul be appreciated
    here is some code i have
    This is the frames class with the first panel added
    public ICUFrame () {
            super("ICU");
            canvas= new ICUPanel();
            add(canvas, BorderLayout.CENTER);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setSize(1000,1000);
            setVisible(true);
        } this is the panel on the frame
    only the constructor is required here as the rest is just code for drawing etc...
    public class ICUPanel extends JPanel {
        DiaDisplay d ;
        SysDisplay s;
        public ICUPanel(){
            super();
            setBackground(Color.BLACK);
            ICUMonitoring monitor = new ICUMonitoring();
            Thread rep = new Thread(new Repainter());
            d = new DiaDisplay(220,20,40,200);
            s = new SysDisplay(420,220,40,200);
            rep.start();
        }// end of constructor
    }this is the 2nd panel i am trying to add to the 1st panel
    public class ECGPanel extends JPanel {
        ecgDisplay e;
         public ECGPanel(){
         super();
         setBackground(Color.white);
         e = new ecgDisplay();
        }// end of constructor
    }

    xiaolixx wrote:
    I am working on a program and need to put one panel into another panel . I have been successful at adding the panel
    however when i do this i cannot set the size of the 2nd panel. The first panel on the frame is just fine
    i have tried.. What happened to your shift key? Please apply it once at the start of every sentence, rather than those rare occasions you 'feel like it'. Adding an upper case letter to each sentence makes it easier for people to quickly scan the text, looking for ways to help. You would not want to make it harder for someone to help, would you?
    ..adding the panel to the first panels constructor this works the panel shows up but i am unable
    to set the size of the panel which is the problem.
    I tried calling this.setSize in the second panels constructor to solve this problem no luck there
    i have also tried adding the 2nd panel to the frame but this produces the same problem as stated above
    im really stumped any help woul be appreciated
    here is some code i haveAlso known as 'uncompilable code snippets'. For better help sooner, post an SSCCE . But first, go through the tutorial to which Darryl linked.

  • Trying to use a popup window as a component  in another component

    Hi guys,
    I am unable to use a popup component in another component in
    Flex .
    Its not calling the popup compopnent.
    Could anyone plz hel me.
    This is my code.
    This is the parent component TitlWindow where i want to call
    my popup
    component.
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="100%" height="100%"
    xmlns:util="userinterfaces.util.*"
    creationComplete="showWindow();"
    title="CREATE PROFILE">
    This is my script where i am writing a function to call a
    component
    whose name is fielupload.mxml
    <mx:Script>
    private function showWindow():void
    pop =
    fileupload(PopUpManager.createPopUp(this,fileupload,true));//
    fileupload.mxml
    is called
    pop.title = "Please enter your login information.";
    pop.showCloseButton =true;
    PopUpManager.centerPopUp(pop);
    pop.addEventListener("close",removeMe);
    </mx:TitleWindow>
    This is the code for fileupload.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" width="100%" height="100%"
    xmlns:util="userinterfaces.util.*" title="File Upload">
    <mx:Script>
    <![CDATA[
    import mx.collections.XMLListCollection;
    import flash.events.Event;
    import flash.events.IOErrorEvent;
    import flash.events.ProgressEvent;
    import mx.controls.Alert;
    import flash.net.FileFilter;
    import flash.net.FileReference;
    import flash.events.SecurityErrorEvent;
    import mx.controls.Button;
    import mx.controls.TextInput;
    import mx.controls.ProgressBar;
    import mx.core.Application;
    import flash.net.URLRequest;
    import flash.net.URLRequestMethod;
    import mx.core.UIComponent;
    import mx.managers.PopUpManager;
    public var fileFilterImage:FileFilter = new
    FileFilter("Images","*.png;*.gif;*.jpg");
    public var fileFilterDocument:FileFilter = new
    FileFilter("Documents", "*.txt;*.doc;*.pdf;*.rtf");
    public var fileFilterArchives:FileFilter = new
    FileFilter("Archives", "*.zip;*.tar;*.hqx");
    public var fileFilterAll:FileFilter = new
    FileFilter("All", "*.*");
    public var fileRef:FileReference;
    public var selectedId:String;
    public function init():void {
    fileRef = new FileReference();
    fileRef.addEventListener(Event.CANCEL,
    traceEvent);
    fileRef.addEventListener(Event.COMPLETE,
    completeEvent);
    fileRef.addEventListener(Event.SELECT,
    selectEvent);
    fileRef.addEventListener(IOErrorEvent.IO_ERROR,
    traceEvent);
    fileRef.addEventListener(Event.OPEN, traceEvent);
    fileRef.addEventListener(ProgressEvent.PROGRESS,
    onFileProgress);
    fileRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    traceEvent);
    public function traceEvent(event:Event):void {
    var tmp:String =
    "================================\n";
    public function
    ioErrorEvent(event:IOErrorEvent):void{
    Alert.show("IOError:" + event.text);
    traceEvent(event);
    public function selectEvent(event:Event):void{
    //var selectedId:String =
    selectButton(event);
    //Alert.show("i am in id" +
    Application.application.winMyProfile.selectedId);
    btnUpload.enabled = true;
    iptFile.text = fileRef.name;
    public function
    selectButton(catchButton:Event):void{
    var newButton : Button = new Button;
    newButton = catchButton.currentTarget
    as Button
    selectedId = newButton.id;
    //Alert.show("i am in id" +
    selectedId);
    public function
    onFileProgress(event:ProgressEvent):void {
    prgBarUpload.label = "Loaded " +
    event.bytesLoaded + " of " +
    event.bytesTotal + " bytes";
    prgBarUpload.setProgress(event.bytesLoaded,
    event.bytesTotal);
    public function
    completeEvent(event:Event):void {
    Alert.show("File Uploaded
    Successfully");
    btnUpload.enabled = false;
    btnBrowse.enabled = true;
    public function uploadFile(url:String):void {
    url = url + "?
    folder="+Application.application.winLogin.userInfo.getUsername();
    var req:URLRequest = new
    URLRequest(url);
    req.method = URLRequestMethod.POST;
    var folder:String =
    Application.application.winLogin.userInfo.getUsername();
    fileRef.upload(req, folder,true);
    ]]>
    </mx:Script>
    <mx:VBox id="vbMain" width="100%" height="60">
    <mx:HBox width="100%" height="22">
    <mx:TextInput height="22" id="iptFile"
    width="100"/>
    <mx:Button id="btnBrowse" label="Browse"
    click="selectButton(event),fileRef.browse([fileFilterAll]);"
    />
    <mx:Button id="btnUpload" label="Upload"
    enabled="false"
    click="uploadFile('fileupload.do');" />
    <mx:Button id="btnCancel" label="Cancel"
    enabled="false"
    click="PopUpManager.removePopUp(this);"/>
    </mx:HBox>
    <mx:ProgressBar width="200"
    source="iptFileResume" height="5"
    id="prgBarUpload" mode="manual"/>
    </mx:VBox>
    </mx:TitleWindow>
    Its not even showing any error , i dont know whats the
    problem with
    it.
    Thanks for your help,
    Mario.

    If I understand, you want to display a popup Titlewindow from
    within another popup TitleWindow? This is possible.
    Simplify your code to get it working first.
    Tracy

  • Component visibility getting delay while drop the component in the Panel

    Hi,
    In my project I have used drag and drop functionality to drop the Icon from 1st panel to 2nd panel. The 1st panel contains three buttons with different icons and the 2nd panel is added as the destination (Drop place) in the desktop pane. While drag and drop I have used a panel and label to place the icon in the 2nd panel. The icon which is available in the label visibility getting delay(nearly 5 - 10 sec) at the first time drag and drop. After that there is no time delay for the drag and drop. This happens all the time while start my project. I have tried repaint() and revalidate() for all the panels still the delay is there. Kindly suggest any idea to reduce the delay.
    Thanks in advance...

    Component visiblity getting delay while drop the component in the panel in java swing with comment "Kindly suggest any idea to reduce the delay" - A SSCCE  by @MadProgrammer

  • Need help with component label

    Hi all,
    I want to have label for my components. so when any existing components on the page is opened for editing(for example if I open any components in edit mode from foundation, Tab name is seen and if there is multiple tab like in textImage component its confusing what component is that)I am using fieldLabel properties to show label in my component but this properties is not working for me. Please advice...
    Thanks A lot in Advance..

    Hi,
    Yeah, its clear now. sorry for confusion. So as i understood you actually want to show label for your component not the tabs and OOTB using title will not help you. If you want to achieve this then you have to change your hierarchy.
    Yake an example:
    If your current hierarchy is like below
    dialog (tabpanel) --> items (widgetcollection) --> tab1 (panel)--> items (widgetcollection) --> etc.....
    then you have to move your tabpanel inside another panel which has property "layout" and value as "fit", so the new hierarchy will look like this
    dialog (panel) -->items (widgetcollection)-->Main Tab(tabpanel) --> items (widgetcollection) --> tab1 (panel)--> items (widgetcollection) --> etc.....
    and at panel use property "title" to set the main title
    The look and feel will be different than to normal tab panel obviously as you used panel but hope it will be fine.
    Let me know you need more information.
    I would also suggest you to refer - http://dev.day.com/docs/en/cq/current/widgets-api/output/CQ.Ext.TabPanel.html from more info.
    Thanks,
    Pawan

Maybe you are looking for

  • Comparing iPhoto 09 and Aperture 2

    I am giving a presentation on iPhoto and Aperture. Is anyone aware of a comparison table showing the significant differences? It does not need to be too sophisticated, just the basic differences. I stopped using a iPhoto a few years ago when I moved

  • Dbtab Getting Cleared

    Hi All   I am using one Y table for generation of numbers. This table stores the last no generated for a particular combination. But anyhow this table is getting reset and am unable to find the cause. When i wnt through the coding, i found it ok. Fir

  • Oracle db - XI - R/3

    hi,    we have a table in the  oracle 10g database.....  i have to take a few fields and update it into R/3 system. i found out that i need to use jdbc adapter only... can anyone give me a small breif on what should be done... if i can use IDOC's r B

  • I/O device error when trying to backup system image (any advice? please!)

    Having posted this once with absolutely no response, I'll try again. When trying to backup my K330B system image, I get "device error encountered with either the source or the destination (0x8078012D)" and "Additional information: The request could n

  • Stopping or disabling indivisual services in nodeapps.

    Hi All, Could any one kindly let me know how do we disable/stop one of the gsd services like "ons" in RAC. out of the three services only ons has to be stopped. Thanks in advance. Rajiv.