Component Overlapping

Can i have 1 component overlapping another in java with only 1 being on top always.
I want to place a Textbox on a Combo, both being similar in height but the width of the Combo being slightly more than the TextBox.
I want the TextBox to be on top forever , allowing the user to type text whenever he wants to do so.The down arrow of the combo should only be visible & thus the user should be allowed to associate some value with the textbox text.
In java usually the component having focus comes in front.Thus as soon as we move the focus on the combo the textbox goes behind & the combo comes in front.
Can i find a solution.I am using JDK 1.3
I don�t want this to happen.I feel there would be a method by which I can restrict this from happening.

i checked this link & didn't find anything relative.
As i said i have my code already in place & if i replace the component i cud face a prob. ...becoz
the change effects several files.......
Lets consider this again....
Suppose i have alibrary of books...
Let's say i have a textbox in place .I click on the lookup button placed next to it which displays all the books in the library.
From that i wud be selecting 1 record whose details i see
on the screen.Now i wud be wanting to give the user a criteria where he can see books within a particular date ..like if we wants to view books which have arrived in the past 1 month ..or likewise.
Now the aim is to achieve this without any code or component change.
I cud have had a combo directly placed next to the Textbox.It cud have values 1 month, 3 months, 6 months, 12 months...
displayed.The user wud select 1 value & click on the lookup & he wud be able to see relevant recodrs.
But i don't want to display the entire combo.Thus what i felt was that we cud have the textbox & combo ..
of the same ht...but differing in width. Now only the dropdown arrow of the combo wud be seen.
The user wud click on it & select 1 value.
When he wud click on the lookup he wud thus see the records for the selected no. of the days....
I made a small sample ..what i saw was that when i select a value from the combo...the textbox was moving behind it...i wanted to avoid this from happening....i have included quite a lot of content...sorry abt. taht...but that's coz i thought u were not very clear with my requirement.....i can't paste the diagram...how did u draw those lines the other day...i cud have used a picture......
well...hope to hear from u soon....

Similar Messages

  • About component overlapping

    Hi guys..
    I'm doing some overlapping to some components..based on research...i found out there maybe two ways to doing so....one is by using the JLayeredPane...another is using the setComponentZorder method...who can tell me which approach is better and efficiant...thanks...

    There are problems when using Z-Order with some components. For examples when you use overlap JButtons you can get unexpected results. When you move the mouse over the overlapped button, the rollover code will cause the button to paint overtop all other buttons.
    I had not tested this with a JLayeredPane so I'm not sure if you get the same effect or not.
    Try playing with the demo code from the section in the Swing tutorial on "How to Use Layered Panes".

  • Overlapping with html component

    Hi,
    Html component overlaps dropdown menu bar i.e when pdf is opened with in html componenet
    I have a problem with html component in flex...
    I have 12 drop down menus on top of the page...
    On click of item in dropdown the corressponding file opens in html component....
    There is no problem if its html file file....
    But  if pdf opens in html component the dropdown menu goes behind the pdf file....
    i.e  pdf file in html component overlaps drop down menus...
    Pls let me know how we can overcum this.....
    Thanks & Regards

    I never did find a solution for this.  The Reader just doesn't support it.  What I ended up doing back then was to use ColdFusion's CFPDF tag to automatically convert each page in the PDF to an png, then do the touch gestures on the pngs.
    Don Kerr

  • Disabling flash display in Air HTML Component

    Hi,
    in my AIR application, I use an HTML Component in its own
    sort of frame or container that has a viewing size that is smaller
    than the web page itself. Next to it is a panel with many controls
    in it. When a website with flash components (e.g. flash banners) is
    displayed, the flash components in the HTML Component overlap the
    control panel even though it's underneath in another container. Is
    there a way to disable showing Flash in an HTML Component or
    another way to make sure everything in an HTML Component stays on
    its own layer?
    Thanks for any help!

    Hi,
    I don't think the problem is because the URL is pointing to a
    JSP. I think the problem might be with the JavaScript which is
    trying to do operations which are not allowed. Please find more
    details at the URL below.
    http://livedocs.adobe.com/flex/3/html/dg_part_7_1.html
    Hope this helps.

  • Component dropped on the 'Drag components or assets here' band, unable to edit

    Hi,
    I have got a weird problem and wish someone had come across this during their development:
    I have a component which works perfectly normal up until now, there are some author content changes but apart from that there's no code changes.
    This component allows drag and drop, but instead of landing on a blank space, now it lands exactly on top of the 'Drag components and assets here' band, which makes it impossible to edit when double clicked. Because it is overlapping with the 'Drag components and assets here' band, everytime it is double clicked a dialogue is popped up, says 'insert new component'. If you right click then you get only one menu option 'new', just like when you right click on the 'Drag components and assets here' band.
    I know I can add 'cq:actions' properties to cq_editConfig to allow edit and delete, but it looks really bad because the author still sees a component overlapping with the 'Drag components and assets here' band.
    I'd appreciate if you can shed some light on this!

    I would recommend inserting some text into the component's jsp that is only visible while in edit mode (such as below)
    if(WCMMode.fromRequest(request) == WCMMode.EDIT && YOURBLAHSTUFF !=null){
         Please add content for this component here
    that way you can see SOMETHING in that component's rendered area - even if 'YOURBLAHSTUFF" is empty

  • *How to dynamically create a layout component*

    I have a table component that is bound to a database table ,I want to be able to add a layout component holding submit button and cancel button to the page at the end of the table component dynamically,so as to avoid the lenght of the table component overlaping the layout button.Pls I'll really appreciate a quick response.
    Thanks in advance.

    Hi!
    Try to read this:
    http://blogs.sun.com/winston/entry/button_header_table
    I hope it will help You.
    Thanks,
    Roman.

  • JMenu is behind Canvas. problem ?

    I have created a JFrame with a JMenuBar,
    I have added a ImageCanvas (sub class of Canvas) in the center of the JFrame
    but whenever i click on Menu it appears behind the canvas
    what to do pls help?

    Hey,
    Canvas is an awt component meaning it is a heavyweight
    component. The swing components are lightweight.
    Thats the problem.
    Have a look at the following URL.
    http://java.sun.com/products/jfc/tsc/articles/mixing/
    It should explain about mixing heavyweight/lightweight
    components
    Basically you either need to use Frame, Menu and
    canvas or JFrame, JMenu and JPanel.
    nesAnd heres the important part:
    "When a lightweight component overlaps a heavyweight component, the heavyweight component is always on top,
    regardless of the relative z-order of the two components."
    Use JPanel instead of canvas if your using swing.
    regards,
    Tim

  • Outer object catching the event

    Hi,
    It seems like a mouseclicked event it not handled by the correct object.
    I have overlapping Components and only the component above receives the event.
    But, if I go to the same pages using other options then, the mouseclicked events is process correctly, by the inner component.
    When I use the debugger, depending which thread I process first, I may or may not have the mouseclicked events is process correctly.
    Is it related to mixing swing & awt? Is it related the the threads, maybe a component is not realized yet? I don't know mush about component and hope someone can help me or give me some directions.
    Thank you.
    Stephan

    I am pasting a part of the page found on the first link which I gave:
    Heavy vs. light: the differences
    There are some significant differences between lightweight and heavyweight components. And, since all AWT components are heavyweight and all Swing components are lightweight (except for the top-level ones: JWindow, JFrame, JDialog, and JApplet), these differences become painfully apparent when you start mixing Swing components with AWT components.
    The differences boil down to the following:
    A lightweight component can have transparent pixels; a heavyweight is always opaque.
    A lightweight component can appear to be non-rectangular because of its ability to set transparent areas; a heavyweight can only be rectangular.
    Mouse events on a lightweight component fall through to its parent; mouse events on a heavyweight component do not fall through to its parent.
    When a lightweight component overlaps a heavyweight component, the heavyweight component is always on top, regardless of the relative z-order of the two components.

  • No Overlap Container Component

    I want to write a component that will allow children to be added, but will prevent them from overlapping. I have played around with a few collision detection type things, but I haven't been successful. I'm posting this to see if I can get some feedback, ideas, brainstorming about this.
    Ideally I'd like children to be positioned randomly or by a "layout function" (that could be customized).
    Thanks in advance.
    EBN

    Hi,
    how do I get the SAP Netweaver AS ABAP 7.1 product to show up as installed on the server in SLD if it was already installed - see products are assigned to technical system.........so for a AS ABAP 7.1 system, login to that ABAP system and by transaction RZ70 publish it to your XI system SLD......then you can see all the product and sw component installed on this ABAP system in the technical system of WebAS as ABAP type in your XI SLD.........then you can create a business system for it and add all the sw components to this business system which are in the products coming in its technical system.
    What if the product was a home grown product such ZMYPRODUCT ? - why will you need to do this for a AS ABAP system........this thing will be required for a third-party system and so it can be manually added in the technical system for your third-party system in SLD.........
    Regards,
    Rajeev Gupta

  • Jpanel overlap Forms Component

    Hi all,
    I'm using forms 11g, now i try to add one JPanel (Swing) to DrawPanel (Oracle forms DrawPanel), I add the panel first after that I add other Forms component such as VTextField, VBUtton, after that I change Z-order of JPanel to last index (because i want Jpanel will be overlapped by other forms components) .
    But the result always show the JPanel overlap Form Component.
    For more detail you can view this link : [http://stackoverflow.com/questions/7764532/jpanel-overlap-other-components]
    Thanks in advance
    Best regards,
    Edited by: 891733 on 21:05 16-10-2011

    Hi,
    When i change JPanel to Forms DrawnPanel, i still got this problem,
    And i've already added this post to Java Programming Thread
    jpanel overlap Forms Component

  • How to tell if your component is being overlapped by another

    Hi,
    I've run into a problem implementing a menu bar into my program. Here's a little graphic. :)
              |  FILE     EDIT                                                              |
              |                                                                                            |
              |                                                                                            |
              |                                                                                            |
              |     Some custom component         CustomPanel     |
              |                                                                                            |
              |                                                                                            |
              |                                                                                            |
              ----------------------------------------------------------------------Except my component uses an active rendering loop, so it covers over the flip down menu. Is there anyway to tell when something is covering the CustomPanel? Or is there anyway to explicitly tell a component to paint all overlapping components on it?
    such as: CustomPanel.paintOverlappingComponents().
    or something like that?

    Menus in swing are light weight components i believe.
    if you want them to appear over the top of an actively rendered Component, you are going to need to either :-
    1) forcefully repaint the menus as part of the active rendering. (so, repainting them each loop)
    2) when performing the active rendering, add a clip region that excludes the area that the menus take up. (avoid overpainting them at all)
    In either case, you are going to have to query the menus each render loop, to determine if they are showing or not.
    I would go for solution 2, it should be quicker.

  • JApplet overlapped by HTML (DHTML component)

    hello,
    i have written a JApplet and it is embedded in a html page. the html page has a MS-word menu bar like menu, the JApplet overlaps the DHTML written main menu (when main menu's mouseover event is triggered, the sub menu shows up). how can i bring the sub menu in front of the JApplet?
    Thanx

    I do have some info about the z-ordering thing in general, though - if you didn't know this already. You can define a layer using the following notation:
    <div id="myPopupMenuLayer" name="myPopupMenuLayer" style="position:absolute; left:0px; top:0px; width:224px; height:174px; z-index:6; visibility: hidden ">
    <!--table containing menu goes here -->
    </div>
    ...and if you have several of these all showing at the same time, you can determine their "stacking order" by assigning different values to the "z-index" parameter. As I said, though, I believe browsers will not display any HTML layers over an applet, no matter what you set z-index to.

  • Overlapping component event trigger problem

    I create a layeredpane, two levels there...top level with a jlabel with image...bottom level is a jbutton...i need to put the jlabel just above the button. these all done..both the button and jlabel have actionlistener associate with them...now the problem is, once i click the jlabel, both actionlistener will receive the actionevent and trigger some function....how do i make the button's listener do not response to the click when i click the label above it....thanks....

    well, this is the code snippets
    JLayeredPane layeredPane=new JLayeredPane();
         JPanel buttonPanel=createButtonPanel();
         Insets insets=layeredPane.getInsets();
         buttonPanel.setBounds(insets.left, insets.top, 800, 50);
         layeredPane.add(buttonPanel,new Integer(10));
         JLabel triangle=new JLabel(createIcon("icons/triangle2.png",9,10));
         triangle.setBounds(insets.left+525, 0, 9, 10);
            triangle.addActionListener(new labelAction());
         layeredPane.add(triangle,new Integer(20));
         return layeredPane;

  • How to repaint a portion of a component?

    I am working with JLayeredPane and several overlapping components which I draw a selection rectangle around when the user clicks on a component to indicate that it is "selected". If the user selects another component I need to wipe out the selection rectangle on the previously selected component. I'm not sure what the best approach for this is.
    If the initially selected component was underneath (in a lower layer than) another component, I can't simply repaint it without repainting all of the components that are above it. This seems like it could be too much painting just to remove a selection box. Can someone recommend a good approach for this problem?
    Thanks,
    Jonathan

    Thanks for the response. The components should be on separate layers (added via JLayeredPane.add(JComponent) ) so if the painter takes the layers into account, then there must be something else wrong. Here's a quick demo program of what I'm doing:
    import java.awt.*;
    import java.awt.event.MouseEvent;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class LayerDemo {
         private ControlMouseInputAdapter controlMouseInputAdapter = new ControlMouseInputAdapter();
    private static void createAndShowGUI() {
         LayerDemo layerDemo = new LayerDemo();
    JFrame mainFrame = new JFrame();
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {;}
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    mainFrame.setSize(400, 400);
    JLayeredPane layeredPane = mainFrame.getLayeredPane();
    layeredPane.add(layerDemo.createColoredLabel("test1", Color.RED, new Point(20, 20)));
    layeredPane.add(layerDemo.createColoredLabel("test2", Color.BLUE, new Point(40, 40)));
    mainFrame.setVisible(true);
    private JLabel createColoredLabel(String text, Color color,
    Point origin) {
    JLabel label = new JLabel();
    label.addMouseListener(controlMouseInputAdapter);
    label.setText(text);
    label.setOpaque(true);
    label.setBackground(color);
    label.setBounds(origin.x, origin.y, 140, 140);
    return label;
    public static void main(String[] args) throws Exception {
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {createAndShowGUI();}
    private class ControlMouseInputAdapter extends MouseInputAdapter {
    public void mouseEntered(MouseEvent e) {
    JComponent component = (JComponent) e.getSource();
    component.setBorder(BorderFactory.createLineBorder(Color.black));
    public void mouseExited(MouseEvent e) {
    JComponent component = (JComponent) e.getSource();
    component.setBorder(null);
    }

  • Mapviewer legend and note overlap

    I am using Mapviewer 11ea and wish to place a legend above a note in the SOUTH EAST corner of my map. The note is defined in the config file and the legend is provided in the map request. The legend itself seems to create a box larger than required and overlaps the note text below. See the image at http://www.geocities.com/ozspatial/legend-note-overlap.jpg showing the overlap and the large amount of white space at the bottom of the legend.
    The legend component of the request is from the default mapviewer request and looks like:
    <legend bgstyle="fill:#ffffff;stroke:#ff0000" profile="MEDIUM" position="SOUTH_EAST">
              <column>
                <entry text="Map Legend" is_title="true" />
                <entry style="M.STAR" text="center point" />
                <entry style="M.CITY HALL 3" text="cities" />
                <entry style="M.CITY HALL 4" text="big cities" />
                <entry is_separator="true" />
                <entry style="C.ROSY BROWN STROKE" text="state boundary" />
                <entry style="L.PH" text="interstate highway" />
                <entry text="County population:" />
                <entry style="V.COUNTY_POP_DENSITY" tab="1" />
              </column>
      </legend>Does anyone know how to reduce the white space in the legend or some other way to avoid the overlap? (whilst still placing both note and legend in the SOUTH EAST corner)
    thanks,
    Ross.

    Hi Ross,
    I don't think you will be able to reduce the white space at the bottom, but there are some parameters on the legend that you can use.
    1) In overlap situations you can set the transparency of the legend:
    <legend bgstyle="fill:#ffffff;fill-opacity:128;stroke:#ff0000" profile="MEDIUM" position="SOUTH_EAST">
    2) For the profile value there is an internal size defined. In your figure I can note that the advanced style items are also overlapping, which means that the internal size MEDIUM seems not appropriate for this legend. You can assign a height for a legend entry:
    <entry style="V.CA INCOME 2" tab="1" height="150"/>
    3) With version 11 there are two new parameters (location_x and location_y) for the legend that can be used to put the legend in any position. In this case the position attribute is ignored if defined.
    <legend bgstyle="fill:#ffffff;fill-opacity:128;stroke:#ff0000" profile="MEDIUM" location_x="20" location_y="50">
    Joao

Maybe you are looking for

  • Getting the Physical Length of a Piece of Text (in mm etc.) in Javascript

    I'm trying to write a script in Indesign CS5 (Windows) that can measure the physical, 'rendered' length of two pieces of text of similar length (in mm etc.), calculate the average length of the two, and adjust the tracking/horizontal scale of one or

  • Using data in text file as indicator

    hi all   i want to know is there a way to use a text file and use the data in it to represent and name as the label of the indicator ? i have attached a sample text file , what i want to achieve is that as the first row of the text file is 2 3 4 6 ,

  • Files not showing up in Finder

    Hello guys! Recently my Finder has started behaving strangely. Sometimes when i save a file to the desktop (most often when I download something with Safari) it just doesnt show up in the Finder. Then I have to move the file around using the Terminal

  • Java Web Start and CORBA

    Hello, I have a C++ based CORBA server to which a Java based client gets connected. I want to put this java appln. on Java Web Start . The identification of the CORBA server is thru' the published POA name. Can anybody help me in making the java appl

  • Oracle JDBC driver throwing java.nio.BufferUnderflowException exception

    Hi, We have a an application for which the middleware(SAR file) is running on Jboss. We have configured a DCN (data change notification) listener (As part of SAR file) to listen for the databases changes on port 56090. A weekly machine security scan