setting component Z Order

Posted on 2010-11-12
Last Modified: 2012-05-10
I am trying to set ZorderComponent of a button..

I am doing something like this -- panel.setComponentZOrder(button, 0);

After adding this line .. no matter what components I add to panel they do not show up :(

and if I remove this line they do show  :(
Question by:hipal
  • 3
  • 3
LVL 92

Expert Comment

ID: 34126182
could be because the button is painting over all your other components.
can't tell exactly what the problem is without seeing your code

Author Comment

ID: 34126186
no it is not so .. i can see button is just in left corner
LVL 92

Expert Comment

ID: 34126199
is it a standard JButton, or a subclass?
And what is its size?

just because you see it top left doesn't mean its not painting to more of the panel
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

LVL 92

Expert Comment

ID: 34126201
give another component in the panel a lower z order than it

Accepted Solution

hipal earned 0 total points
ID: 34127630
I got the problem .. I was doing a blunder .. I thought that we can assign any Zorder as it is relative .

I mean I just have 2 components and I was trying to assign Zorder 10 to one of them :P

thanks though !

Author Closing Comment

ID: 34162440
I got the mistake I was doing  !

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help Required 3 108
mysql jsp example issue 32 49
what is the best portable software where i can test codes written in different languages 1 52
printf performancy 11 70
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question