Any layout suggestions for this?

How can I place a JCheckBox and JButton components on the area beside the TabbedPane tabs (Top right corner position)?
Final design should be like this image
http://www.rejimani.com/backup/tabbed.jpg
Any suggestions?
Reji Mani

* Test_AbsoluteLayout.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Test_AbsoluteLayout extends JFrame {
    public Test_AbsoluteLayout() {
        initComponents();
    private void initComponents() {
        checkbox = new JCheckBox();
        button = new JButton();
        tabbedpane = new JTabbedPane();
        panel1 = new JPanel();
        panel2 = new JPanel();
        getContentPane().setLayout(new AbsoluteLayout());
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        checkbox.setPreferredSize(new Dimension(83, 21));
        checkbox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                checkboxActionPerformed(evt);
        getContentPane().add(checkbox, new AbsoluteConstraints(350, 0, 20, -1));
        button.setText("OK");
        button.setMargin(new Insets(0, 0, 0, 0));
        button.setPreferredSize(new Dimension(71, 21));
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                buttonActionPerformed(evt);
        getContentPane().add(button, new AbsoluteConstraints(370, 0, 30, -1));
        tabbedpane.setPreferredSize(new Dimension(400, 300));
        tabbedpane.addTab("tab1", panel1);
        tabbedpane.addTab("tab2", panel2);
        getContentPane().add(tabbedpane, new AbsoluteConstraints(0, 0, -1, -1));
        pack();
    private void checkboxActionPerformed(ActionEvent evt) {
        System.out.println("check");
    private void buttonActionPerformed(ActionEvent evt) {
        System.out.println("ok");
    public static void main(String args[]) {
        new Test_AbsoluteLayout().setVisible(true);
    private JButton button;
    private JCheckBox checkbox;
    private JPanel panel1;
    private JPanel panel2;
    private JTabbedPane tabbedpane;
class AbsoluteConstraints implements java.io.Serializable {
    static final long serialVersionUID = 5261460716622152494L;
    public int x;
    public int y;
    public int width = -1;
    public int height = -1;
    public AbsoluteConstraints(Point pos) {
        this(pos.x, pos.y);
    public AbsoluteConstraints(int x, int y) {
        this.x = x;
        this.y = y;
    public AbsoluteConstraints(Point pos, Dimension size) {
        this.x = pos.x;
        this.y = pos.y;
        if (size != null) {
            this.width = size.width;
            this.height = size.height;
    public AbsoluteConstraints(int x, int y, int width, int height) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
    public int getX() {
        return x;
    public int getY() {
        return y;
    public int getWidth() {
        return width;
    public int getHeight() {
        return height;
    public String toString() {
        return super.toString() +" [x="+x+", y="+y+", width="+width+", height="+height+"]";
class AbsoluteLayout implements LayoutManager2, java.io.Serializable {
    static final long serialVersionUID = -1919857869177070440L;
    public void addLayoutComponent(String name, Component comp) {
        throw new IllegalArgumentException();
    public void removeLayoutComponent(Component comp) {
        constraints.remove(comp);
    public Dimension preferredLayoutSize(Container parent) {
        int maxWidth = 0;
        int maxHeight = 0;
        for (java.util.Enumeration e = constraints.keys(); e.hasMoreElements();) {
            Component comp = (Component)e.nextElement();
            AbsoluteConstraints ac = (AbsoluteConstraints)constraints.get(comp);
            Dimension size = comp.getPreferredSize();
            int width = ac.getWidth();
            if (width == -1) width = size.width;
            int height = ac.getHeight();
            if (height == -1) height = size.height;
            if (ac.x + width > maxWidth)
                maxWidth = ac.x + width;
            if (ac.y + height > maxHeight)
                maxHeight = ac.y + height;
        return new Dimension(maxWidth, maxHeight);
    public Dimension minimumLayoutSize(Container parent) {
        int maxWidth = 0;
        int maxHeight = 0;
        for (java.util.Enumeration e = constraints.keys(); e.hasMoreElements();) {
            Component comp = (Component)e.nextElement();
            AbsoluteConstraints ac = (AbsoluteConstraints)constraints.get(comp);
            Dimension size = comp.getMinimumSize();
            int width = ac.getWidth();
            if (width == -1) width = size.width;
            int height = ac.getHeight();
            if (height == -1) height = size.height;
            if (ac.x + width > maxWidth)
                maxWidth = ac.x + width;
            if (ac.y + height > maxHeight)
                maxHeight = ac.y + height;
        return new Dimension(maxWidth, maxHeight);
    public void layoutContainer(Container parent) {
        for (java.util.Enumeration e = constraints.keys(); e.hasMoreElements();) {
            Component comp = (Component)e.nextElement();
            AbsoluteConstraints ac = (AbsoluteConstraints)constraints.get(comp);
            Dimension size = comp.getPreferredSize();
            int width = ac.getWidth();
            if (width == -1) width = size.width;
            int height = ac.getHeight();
            if (height == -1) height = size.height;
            comp.setBounds(ac.x, ac.y, width, height);
    public void addLayoutComponent(Component comp, Object constr) {
        if (!(constr instanceof AbsoluteConstraints))
            throw new IllegalArgumentException();
        constraints.put(comp, constr);
    public Dimension maximumLayoutSize(Container target) {
        return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
    public float getLayoutAlignmentX(Container target) {
        return 0;
    public float getLayoutAlignmentY(Container target) {
        return 0;
    public void invalidateLayout(Container target) {
    protected java.util.Hashtable constraints = new java.util.Hashtable();
}

Similar Messages

  • I would like to get certified for the SAP Crystal Reports. So, I would like to get some info about the currently available Certification Exams for Crystal Reports (2011/2013). Also, would greatly appreciate  if you have any suggestions for thi

    Hi,
            I would like to get certified for the SAP Crystal Reports. So, I would like to get some info about the currently available Certification Exams for Crystal Reports (2011/2013). Also, would greatly appreciate  if you have any suggestions for this Certification Exam preparation materials from another 3rd party or from SAP directly .  I would like to prepare or get trained well before taking the exam as I see it costs around $500.
    Thanks in advance for your help in this regard!
    Sincerely,
    J

    Please search here.. Training and Certification Shop for your desired certification or training. Don't forget to set your location.
    Please use some summarized title for your query.

  • I started to have connectivity issues with a linksys router.  The linksys rep suggested ...Check from Apple if they have some particular ports for the Apple TV that we might need to open on the router, anyone have any suggestions for this?

    I started to have connectivity issues with a linksys router.  The linksys rep suggested ...Check from Apple if they have some particular ports for the Apple TV that we might need to open on the router, anyone have any suggestions for this?

    Hi RonWM,
    Thanks for visiting Apple Support Communities.
    This article lists the ports that are used by the Apple TV:
    Apple TV: TCP and UDP ports and protocols used
    http://support.apple.com/kb/HT2463
    Best Regards,
    Jeremy

  • I want to communicate with J1850 system. Is there any hardware available for this?

    I would like to communicate with a J1850 system. I am wondering whether there is any hardware available for this similar to CAN. Is there a possibility to find exampls for this kind of communication.

    On Fri, 16 Jul 2004 14:02:48 -0500, Mudda wrote:
    > I would like to communicate with a J1850 system. I am wondering whether
    > there is any hardware available for this similar to CAN. Is there a
    > possibility to find exampls for this kind of communication.
    I'm still new in this area but I will try to help. AFAIK, J1850 comes in
    two flavors: VPW and PWM. You can purchase an adapter that converts RS232
    signals to those required by J1850 for about $100.
    I suggest using an adapter from Scantool.net. I say this because I
    have one and it's very easy to use. It's flexible enough to use with a
    terminal (hyperterminal, minicom, etc.) or to interface with LabVIEW, as I
    have done for you already. Go to OpenG.org for the download:
    http://openg.org/tiki/tiki-index.
    php?page=On+Board+Diagnostic+-+OBDII
    Let me know if it works for you. The interface is a little weak but the
    VIs should clue you in on how to handle communications. I plan to add
    another update in a few days so check the site regularly. I would
    appreciate your feedback.
    -kevin

  • Is there any system variable for this date format 01/21/2004 18:00:32

    Hello,
    Is there any system variable for this date format 01/21/2004 18:00:32
    This is my Internal date format and my External date format is sy-datum.
    How can I validate....any suggestions will be apprecaited!
    Regards,
    Kittu

    Hello,
    Thank you very much for your response!
    My internal date format is 01/21/2004 18:00:32
    and external date format on selection-screen is sy-datum.
    My external format is stored in S_crtsp
    and internal format is stored in L_crtsp. (01/21/2004 18:00:32)
    I want to remove the time from the internal format and validate it aginst the external format.
    Any suggestions or brief explonation is appreciated...I apprecaite the help soo far...
    Regards,
    Kittu

  • Ios7 bookamrking web application to home screen via Safari crashes after login and when we try to open any link inside. Can anyone please tell me if there is any scheduled fix for this bug in safari?

    ios7 bookmarking web application to home screen via Safari, crashes after login and when we try to open any link inside from the icon that gets created on the home screen. Can anyone please tell me if there is any scheduled fix for this bug in safari?
    From what i understand i see that - Cookies are not transferred between your website and your webapp when installing the icon on the home screen (for authentication purposes for example). It was working until 6.1 and now it’s not working anymore.
    Can someone please tell me if this bug will be fixed in any future release, if so the ticket number of some kind that i can track, or if there is a workaround for this issue?

    ios7 bookmarking web application to home screen via Safari, crashes after login and when we try to open any link inside from the icon that gets created on the home screen. Can anyone please tell me if there is any scheduled fix for this bug in safari?
    From what i understand i see that - Cookies are not transferred between your website and your webapp when installing the icon on the home screen (for authentication purposes for example). It was working until 6.1 and now it’s not working anymore.
    Can someone please tell me if this bug will be fixed in any future release, if so the ticket number of some kind that i can track, or if there is a workaround for this issue?

  • Is there any size limit for this DB?

    Hi,
    We have installed SQL Express 2012 DB and configured as a results store for the VSTS 2012 load tests.
    Do we have the size restriction of 4 GB to this DB as well? or we dont have any size restriction for this DB?
    Thanks in advance.
    Regards,
    Y.S.Sridhar

    Hi 
    Express maximum db size limit is 10gb
    http://msdn.microsoft.com/en-us/library/cc645993(v=SQL.110).aspx
    vt
    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

  • Is there any retro effect for this changes we made in 2001 Infotype for

    HI Experts...
    Please advice me on the follwing absence issue.
    In my clients company.... .... one of Personnel areas employees Earned leave records are not updating in 2001 Infotype from the begining.
    Now they wish to have to update in 2001 Infotype.
    What  are the  Retro effects after updating the EL s in 2001 IT for previous dates.
    Is there any retro effect for this changes we made in 2001 Infotype for the past dates.
    We dont need retro effected from those changes.
    Please advice...
    Sai.

    HI Vincent....
    Thanks for the reply.
    Last month professional tax rates were shown up correctly only.
    For the employees slab rates are similar  that is  200 per month.
    Last month professional  tax rates  were correct only.
    For the current month also the prof tax amount is showing up correctly only.
    Please advice to get the professional tax amount in the payslip.
    Regards,
    V Sai.

  • The artwork for our podcast, "Japan Baseball Weekly," recently disappeared. The RSS feed info appears to be in order, any particular reason for this and what can be done to rectify the situation?

    The artwork for our podcast, "Japan Baseball Weekly," recently disappeared. The RSS feed info appears to be in order, any particular reason for this and what can be done to rectify the situation?

    Please always post the URLs of the Store page and the feed when you have a question. For reference, your feed is at
    http://www.japanesebaseball.com/services/jbw-podcasts.jsp
    and the Store page is at
    http://itunes.apple.com/gb/podcast/japan-baseball-weekly/id443149184
    Looking at the Store page, the image appears there perfectly well. On subscribing there is no image associated with the episodes because you haven't embedded an image in the files - please see this page for clarification:
    http://homepage.mac.com/rfwilmut/notes/coverart.html

  • I have upgraded my iPhone 4S to ios 6... I am surprised to see that the wi-go option is grayed out.. I did reset all the setting but no luck... Is there any fix coming for this or will apple exchange the device??? I want wi-fi option back

    I have upgraded my iPhone 4S to ios 6... I am surprised to see that the wi-go option is grayed out.. I did reset all the setting but no luck... Is there any fix coming for this or will apple exchange the device??? I want wi-fi option back

    Seems like a wide spread problem. See this post: https://discussions.apple.com/thread/4310121?tstart=0

  • I am using iPhone 4 : i OS 7. When the phone is in sleep mode i cannot disconnect unwanted incoming call, Is there any upgrade coming for this for iPhone 4 users

    Dears,
    I am using iPhone 4 : i OS 7. When the phone is in sleep mode i cannot disconnect unwanted incoming call, Is there any upgrade coming for this for iPhone 4 users. How this can be sorted

    Hello Bibhore,
    Calls can be declined by hitting the sleep/wake button twice quickly.
    Decline a call and send it directly to voicemail. Do one of the following:
    Press the Sleep/Wake button twice quickly.
    iPad User Guide - When someone calls
    http://help.apple.com/ipad/7/
    Cheers,
    Allen

  • Is there any alternative logic for this issue

    Hello all ,
    I have a  program which is executed as a background job for every 15 minutes . Now my requirement is If this batch job is successfully finished, i have to capture that time and date at which the batch job is successfully finished and update the corresponding time and date in a ZTABLE .
    In order to achieve this , i have created a separate program which will also be running in background.in this program , using the table TBTCO, i m getting the last date and  last time at which the batch job is successfully finished and modifying the ZTABLE accordingly
    Is there any alternate solution for this ?
    thanks&regards,
    G.Pavan

    Hi gpavansap,
    When you define background job in SM36, your first step should be the program which you have scheduled now.
    Create a second step in the same job with another program which would just update system date and time to the ZTABLE. No need to read TBTCO and all.
    The second step would immediately execute as soon as the first step ended successfully.
    If you don't want to create a separate program. you can have a check-box "Update ZTable Only" in the selection screen of the first program itself. If this check-box is selected, the program should only update ZTABLE and do nothing else. Create a variant of your selection screen with this check-box selected and schedule this variant as "Second Step" of your back-ground job.
    Regards
    Suresh

  • After updating to ios 5, my calendar sometimes freezes when entering a new event. I have tried syncing but it doesn't fix the problem. Are there any bug fixes for this? Any ideas would be great thanks, I don't really want to have to reset everything!

    After updating to ios 5, my calendar sometimes freezes when entering a new event. I have tried syncing but it doesn't fix the problem. Are there any bug fixes for this? Any ideas would be great thanks, I don't really want to have to reset everything!

    Try to reset the iPod by  pressing the home and sleep button for about 10sec, until the Apple logo comes back again. You will not lose data doing a reset, but it can clear some glitches after installing new software or apps.

  • HT1420 i am trying to authorize my new computer.  i cannot find any menu option for this in the Itunes store.

    I am trying to authorize my new computer for Itunes.  I cannot find any menu option for this in the computer store

    Authorization and Deauthorization
    Macs:  iTunes Store- About authorization and deauthorization.
    Windows: How to Authorize or Deauthorize iTunes | PCWorld.
    In iTunes you use the Authorize This Computer or De-authorize This Computer option under the Store menu in iTunes' menubar. For Windows use the ALT-S keys to access it. Or turn on Windows 7 and 8 iTunes menus: iTunes- Turning on iTunes menus in Windows 8 and 7.
    More On De-authorizing Computers (contributed by user John Galt)
    You can de-authorize individual computers, but only by using those computers. The only other option is to "de-authorize all" from your iTunes account.
      1. Open iTunes on a computer
      2. From the Store menu, select "View my Account..."
      3. Sign in with your Apple ID and password.
      4. Under "Computer Authorizations" select "De-authorize All".
      5. Authorize each computer you still have, as you may require.
    You may only do this once per year.
    After you "de-authorize all" your authorized computers, re-authorize each one as required.
    If you have de-authorized all computers and need to do it again, but your year has not elapsed, then contact: Apple - Support - iTunes - Contact Us.

  • I turned off my Verizon phone in Birmingham getting on a plane to Houston. When I arrived tonite I turned it back on and it says"searching" I do not have it in airplane mode and I have done a soft reset. Any other suggestions. This is a new iPhone 5

    turned off my Verizon phone in Birmingham getting on a plane to Houston. When I arrived tonite I turned it back on and it says"searching" I do not have it in airplane mode and I have done a soft reset. Any other suggestions. This is a new iPhone 5

    In settings>general>restrictions>location services>system services do you have cell network search set to off? If so turn it on and it may help to find a signal faster.

Maybe you are looking for

  • Cost element in FRL in obyc

    hi all we have created external service account as cost element and that is mentioned iin transaction key FRL in obyc so whenever i am doing the GR for subcontracting posting system will debit the FRL account and will credit the  GR/IR account  so at

  • What if i load transaction data without loading master data

    Hello experts, What are the consequences if i load transaction data without loading master data?Are there any other factors except the load performance because of SID generations etc and inconsistencies. <b>What kind of potential inconsistencies will

  • Search Help in Webdynpro For ABAP

    Hi Experts,                   In my application I want to attach search help to a field. My problem is that table field for which I am creating search help contains duplicate values. I dont want those duplicate values. How can I achieve this? I am us

  • Recovery media creation does not work properly,how can i make recovry disk

    when i started recvry med cretion it collected files for 50 mins then i inserted sony dvd, it started writing then suddenly ejected the dvd asking that (use dvd-r or dvd+r, no RW dvd can be used for this ). i checked my dvd.it was correct. my dvd is

  • Help with GridBagLayout

    Okay, I'm trying this GridBagLayout thing, and I just can't wrap my head around it. Can someone please help me? I have a simple JFrame (code posted below), and it is set to the size of my screen, 1024x768. I have three JPanels I want placed a certain