Creating filling panel with insets without gridbaglayout

Hi,
This is quite a newbie prob but i can't seem to get it right. I want a Panel with two panels. Both with insets. I want the first to only fill horizontally. The second has to fill-up the rest of the panel. Because Boxlayout and Borderlayout don't support insets with layout i tried the gridbaglayout, but i can't get the second panel to fill the remainder of the panel. It stops halfway.
contentPane.add(one,
new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL,
new Insets(2, 2, 2, 2), 0, 0));
contentPane.add(two,
new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER,
GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
Can anyone tell me how to do this?
Much thanks
Hugo Hendriks

You can use:
panel.setBorder(BorderFactory.createEmptyborder(2,2,2,2));
to set insets on a JPanel. I believe Insets is the "old" way of doing borders.
Regards,
Tim

Similar Messages

  • How do we create a panel with a title on it

    How do we create a panel with a title on it (something like the titled border in java swing)

    Thanks John,
    But, I already have a panel box with many panel form layouts inside and would like to have a title on one of the panel form layouts. So, a panel box isn't the one I am looking for.
    More like the titled border shown in here [http://java.sun.com/docs/books/tutorial/uiswing/components/border.html#demo]
    thanks again
    Anwar

  • Rants: Easier way of creating SWF panels with CS5?

    Last week I got a fairly advanced SWF panel in Photoshop CS4 running executing JSX scripts. But when I started to look into developing for CS5 everything changed and former SWF panels and their scripts do not work anymore in Photoshop CS5. And honestly I think there are way to many complicated little steps in the way to just get started. I am probably stuck on this for several weeks just to get a hello world demo running- and I am not sure If I want that. Getting the CS4 version running was a matter of 3 nights, even though back then the documentation was really hard to find and often incomplete.
    So upon studying the SDK and the tutorials that adobe provides I noticed a few annoying blockers in my way
    Adobe Flash builder dictation, some things are very restrictive and shown only for just that IDE platform. My choice of scripting environment is FlashBuilder however for various reasons (free and coding speed are 2 of them). The documentations and Tutorials however hide many important steps that are going on in the background. If the compiler gets certain arguments I need to know that, same if some ANT scripts or alike deploy files to certain folders.
    upon configuring my computer before scripting I had to change a windows registry key (HKEY_CURRENT_USER\Softwarea\Adobe\CSXS2Preferences, playerDebugMode = 1). However that key entry doesn't even exist to begin with on my Windows 7 computer even though Photoshop CS5, Extention Manager and ExtendScript Toolkit are present and installed.
    I need a special SDK compiler instead of the latest FlexSDK, this makes things only more complicated and confusing. I have it now but to figure that out took a while, as this is completely different from how things used to work with CS4.
    Everything is flex focused it would be nice if some tutorials could have a focus on pure AS3 as well, for those who don't like the Flex framework or GUI.
    CS4 and CS5 (Photoshop) seem to be incompatible in the way one can deploy or create SWF panels, this is a major down for any developer that is interested in supporting booth applications. I happen to work in a environment where still a majority of people work with CS4. Also the CS4 documentation (Photoshop) for the SWF panels seem to have vanished, this makes this issue even worse.
    So what I want is:
    The most minimalistic working example straight to the point just to get a SWF panel in Photoshop CS5 running executing some JSX script using eval for example. This is easy in CS4 but very restricted and complicated in CS5 .
    dropping a SWF file in the Photoshop/plugins/panel folder works but it resizes wrong (even though stage.scaleMode is set to noScale), and any CSXSInterface methods seem to be ignored (CSXSLibrary-2.0-sdk-3.4-public.swc used).
    I think I gave up for now on CS5, to restrictive, complex and incompatible with CS4 are my main complaints- I hope this gets through as some feedback - or maybe there is a answer on all my questions?

    Hello,
    one answer to your last question could be this cookbook, then as you probably already know there's the Photoshop panel developer's guide (the CS5 isn't that different from CS4...)
    As the #1 messy coder around (and not that much skilled), I understand your complaints. I'm focused on Photoshop only, and the panel guide for CS4  was more than enough. My learning curve with CS SDK is, to put it mildly, steep (since I've not really any previous experience with Flex - and I agree, using 3.4 SDK and not 4.0 may lead to some confusion), but I'm optimistically confident that CS SDK for CS6 will be far more usable.
    I find particularly annoying that to make life easier Adobe created CS Extension Builder, but to get it is nearly impossible (at least for me: I don't know if Gmail can't get thru Adobe mail server spam control, but in the last 4 months I wrote several emails to Roger Risdal, the "Partner Product and Business Developer Manager" in order to get info about the developer partnership required, and I got as the only answer a couple of out-of-office autoreply) Rumors say that Adobe's DevNet will undergo some robust changes (when, I don't know)  - I hope they will change their mind about the way Extension Builder will be (or not be) distributed.
    One last optimistic consideration is that the tools needed to deploy an extension (the ucf.jar for instance) and the general workflow (write the manifest.xml, pack everything with that java command line utility into a zip-like file, the .zxp, then write an .mxi to access features like auto-update and re-pack again into *another* .zxp) are far from having a good usability and being straightforward... so far that in my opinion the newer releases will surely be better than this one.
    That said, I understand that experienced developers are happily plunging into CS SDK while I'm having hard times keeping my head above waters, and I'm sure CS SDK will lead to a very interesting future.
    By the way, to drop the SWF in the panel's folder isn't a good idea if you want the extension to have the right dimensions (this is something I've learnt) - the manifest.xml is the right place.
    Ciao,
    Davide

  • Creating a panel with multiple canvasses on it, in complementary colors

        public Dancefloor(Dimension patches, int size, Color color)
            //create JPanel
            super();
            backgroundColor = color;
            numberOfPatches = patches;
            patchSize = size;
            //set Size of Dancefloor, make a conversion because the returned type isn't int but double and the setSize
            //function is only able to handle int
            setSize((new Double( numberOfPatches.getWidth() * patchSize) ).intValue(),
            (new Double( numberOfPatches.getHeight() * patchSize) ).intValue() );
            //set bacground color of the panel
            setBackground(backgroundColor);
            //create a number of patches, as submitted to the constructor(at the moment as Canvas)
            //Create a for loop which will be looped as much times as the number of patches
            for(int d = 0; d < new Double(numberOfPatches.getWidth() * numberOfPatches.getHeight()).intValue(); d++)
                //create a new canvas and set a background for it
                patch = new Canvas[new Double(numberOfPatches.getWidth() * numberOfPatches.getHeight()).intValue()];
                patch[d] = new Canvas();
                patch[d].setBackground(backgroundColor);
                //set another background for the patches that are not even, but have an odd number
                if(d % 2 != 0)
                    float[] colorHSB = color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), null);
                    colorHSB[0] += 0.5;
                    if(colorHSB[0] > 1) {
                        colorHSB[0] -= 1;
                    patch[d].setBackground(new Color(Color.HSBtoRGB(colorHSB[0], colorHSB[1], colorHSB[2])));
        }Above is the code of the constructor of my class called Dancefloor, it attempts to create a panel(the 'dancefloor') with multiple canvasses('patches') on it. The even patches should have the color specified in the constructor, the others should have a complementary color as background. this is done using the last if-statement.
    When executing however, all patches have the color specified in the constructur and so you all you can see is a panel with a background instead of a panel with a patchwork of 2 different color canvasses on it
    I hope this explanation was pretty clear, I hope someone is able to help me out
    thomas

    i would suggest if you are going to use a JPanel, simply create an array of Rectangles that represent all of your patches. Then override the paintComponent(Graphics g) method of the JPanel to and use the fillRect(int x, int y, int width, int height) method from the graphics class to draw all of your rectangles something like this
    JPanel floor = new JPanel() {
         public void paintComponent(Graphics g) {
              super.paintComponent(g);
              for (int j = 0; j < myRectangles.length; j++){
                    g.setColor(whateverColor)
                    g.fillRect(myRectangles[j].x, myRectangles[j].y,
                                     myRectangle[j].height, myRectangles[j].width);
    }btw, you can use the field values width and height from Dimension class to retrieve an int value, insted of using getWidth() and getHeight just call myDimension.height or myDimension.width

  • How to create a popup with link without creating any screen

    Hi experts,
    Is the any function module or way to create a popup with a link inside (for e.g. to forums.sdn.sap.com)?
    I do not want to create any screen and call that screen.
    Thanks,
    Khanh

      CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
        EXPORTING
          TITEL        = 'Title POPUP_TO_DISPLAY_TEXT'
          TEXTLINE1    = 'Message to display'
          TEXTLINE2    = ' '
          START_COLUMN = 25
          START_ROW    = 6.
    CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE'
    EXPORTING
      DEFAULTOPTION        = 'Y'
       DIAGNOSETEXT1        = 'This is Testing'
      DIAGNOSETEXT2        = ' '
      DIAGNOSETEXT3        = ' '
      TEXTLINE1            = 'Do You want to Exit'
      TEXTLINE2            = ' '
       TITEL                = 'POPUP_TO_CONFIRM_WITH_MESSAGE'
      START_COLUMN         = 25
      START_ROW            = 6
    *----for the display of cancel button  do like this.
      CANCEL_DISPLAY       = ' '
    IMPORTING
      ANSWER               = ANS
      IF ANS = 'J' .
    *---put code on selecting yes
      ELSE.
    *---put code on selecting no
      ENDIF.

  • Is it possible to create a panel with JavaScript?

    Hi friends
    As I´m studying JavaScript and the user interface creation...would like to ask (more for curiosity):
    Is it possible to create a new panel for Illustrator using JavaScript? Or this is only possible using C++?
    (in the Window Class UI we have the "palette" creation method..so wondering the result of it too)
    Thank you a lot
    Gustavo

    Hi Larry
    Thank you a lot for sharing this reference. This has alternative explanations from the JavaScript Tools Guide that already come with the Extended Script Toolkit SDK (I´m reading this and finding very very useful).
    My question, however, is not covered in any of the manuals.
    I´d like to confirm if a panel (like Brushes, Swatches, Appearance and Layer Illustrator panels) can be made only via C++??? (and not via JavaScript).
    Can I assume the Script UI capabilites in JavaScript can resume itself on creating dialog boxes only (not panels that persist, keep opened in the software, also could be docked in the side of app)?
    Thank you
    Gustavo.

  • Creating a PDF with transparency without exporting to PDF (Mac)

    Hi
    I need to created a PDF from InDesign that has unflattened (native) transparency without using the export PDF command ( because of the flaw seen here: http://forums.adobe.com/thread/537751?tstart=0 )
    I have tried exporting as an EPS and that flattens transparency and creating PS does as well.
    Any other ideas, settings or applications/utilities to try?
    Thanks
    -Andrew

    Thanks everyone that was what I thought.
    Peter: If we knew when it was happening then we can fix it, unfortunately there is no indicator when it will happen. We get jobs from all over North America from all kinds of designers so it could happen on any job.
    It is hard to say how many job it happens on as in most cases it wouldn't be noticed by the client as the amount is so small, and in some case it would happen in the bleed that gets trimmed.
    So far we have noticed the issue when it happens in a critical situation and haven't had any spoils but it is just a matter of time.
    We are going into Annual Reports soon as well as proffesional sport tickets both of which are critical clients.
    -Andrew

  • Is it possible to create a role with PERM_READER_EXTENSIONS_WEB_APPLICATIONS without Service Invoke?

    I need to restrict user access to Workspace processes.  Using the adminui, service management, I gave my test group INVOKE_PERM permissions to this service.  This works good.  The users of the test group can only see this process.  However, for these users the SOAP calls do not work.  I am using a reader extended form and I am getting the error below.  If I add the Reader Extension Web Application role, the SOAP call work, but the user of the test group can see all other processes.  I created a role and gave it PERM_READER_EXTENSIONS_WEB_APPLICATIONS, Service Read, INVOKE_PERM and other combinations.  This role only works if I add Service Invoke and this give users access to all processes.  How can I get a role to provide the Reader Extension without using Service Invoke?
    An error has occurred. See error log for more details.
    User TORRES, ALEJANDRO G does not have the Service Invoke Permission on Service ReaderExtensionsService.

    I found the answer to my question.  I had to give INVOKE permission to all the services used by the process.

  • Using XML Menu Model Create Left Panel with Panel Accordian and ShowDetail

    Hi all,
    I want to create a custom page template. I have two level menu and I have created xml adf menu mode for that. I want to create a left panel in the template using Panel Accordian(level 1) and show detail item (level 2). Can anyone please tell me how to do that?

    Sample 48 on http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples (though its a security example) has a working configuration for you to have a look at
    Frank

  • Can anyone guide me how to create the databse with or without using the GUI

    I need to create the Database from SQL prompt can any body tell me the links where i can find some sample scripts to do that....Thanks

    Hi,
    I would like to mention few stuffs too..
    for manually.
    1. startup nomount pfile=path of the pfile.
    2. run the create datbase script.
    3. run catalog.sql, catproc.sql script.
    that was the brief idea,but you need to create your sample pfile,setting up your dir locations,setting envrmnts variables.
    for gui envrmnts you have DBCA , use it and forget about all the cavtes.
    thanks
    Alok.

  • Create a Panel skin (Spark) with a background fill color I can pass as a parameter

    Hi,
    I'm trying to create a Panel skin (Spark) with a background fill color I can pass as a parameter.
    (See in bold:)
    <?xml version="1.0" encoding="utf-8"?>
    <s:SparkSkin name="CustomPanelSkin"
                                   xmlns:fx="http://ns.adobe.com/mxml/2009"
                                   xmlns:s="library://ns.adobe.com/flex/spark"
                                   xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
                                   blendMode="normal">
              <s:states>
                        <s:State name="normal" />
                        <s:State name="disabled" />
                        <s:State name="normalWithControlBar" stateGroups="withControls" />
                        <s:State name="disabledWithControlBar" stateGroups="withControls" />
              </s:states>
              <fx:Metadata>
                        [HostComponent("spark.components.Panel")]
              </fx:Metadata>
              <s:Group left="0" right="0" top="0" bottom="0">
                        <s:Rect
                                  left="0" right="0"
                                  top="0" bottom="0"
                                  radiusX="12" radiusY="12">
                                  <s:fill>
                                            <s:SolidColor color="#184c81" />
                                  </s:fill>
                        </s:Rect>
                        <s:Group id="contents"
                                             left="1" right="1" top="1" bottom="1">
                                  <s:layout>
                                            <s:VerticalLayout gap="0" horizontalAlign="justify" />
                                  </s:layout>
                                  <s:Group id="contentGroup"
                                                       width="100%" height="100%" minWidth="0" minHeight="0">
                                  </s:Group>
                        </s:Group>
              </s:Group>
    </s:SparkSkin>
    From what I read I should create a subclass, but there is not much material on the subject.
    I would later on want to use this skin in many Panel controls I have in my application.
    Thanks for the help.

    Did you read this?
    http://www.adobe.com/devnet/flex/articles/flex4_sparkintro.html

  • How to know if a Sales order item created with or without reference

    Hi,
    I am working on user exit USEREXIT_MOVE_FIELD_TO_VBAP, and I just wanted to know if there is a way to know if a sales order item is created with or without reference to a contract.
    I need to write the code in USEREXIT_MOVE_FIELD_TO_VBAP, however, when an SO line item is created with reference the userexit is being called twice and when the SO line item is created without reference the user exit is being called only once.
    My aim is to check if a SO line item is created with reference to a valid contract. If the item is without reference to a contract or the referenced contract is not valid, then I will have to determine the contract based on the customer contracts.
    Any help on this would be greatly appreciated.
    Best regards,
    Siva

    Hi Vindo,
    The Userexit USEREXIT_MOVE_FIELD_TO_VBAP is called twice when the SO line item is created with reference to contract. The first time the user exit is called there will be no value filled in vbap-vgbel and the second time it comes to the userexit then vbap-vgbel will have a value. I think CVBAK-VBELN will contain the reference if the so line item is created with reference and the value of CVBAK-VBELN contrains blank if the item is not referenced. Anyway thanks for your reply.
    Best regards,
    Siva

  • How to create a new Oracle OSB project automaticaly with script without IDE

    Hello,
    I want to create automatically an "Oracle service bus project" and an "Oracle service bus configuration project" with scripts (ANT or Maven or ...) without using IDE, without using workshop or Eclipse. I want to create automatically (ANT or Maven) just a skeleton of an OSB project witch i can use after in workshop.
    I want to create 1 "Oracle service bus configuration project" with many "Oracle service bus project" automatically (ANT or Maven or scripts) witch i can use after in workshop. How to create a new Oracle OSB project automaticaly with script without IDE ? How can i do this ?
    I'm using Oracle service bus 10.3.1
    Thank you for your help.

    Thank you for your response,
    I do not want to just create the services (proxy services and business services) but I want to create a template for 40 OSB project with the same scripts ANT/Maven.
    Template="Oracle service bus configuration project" + "Oracle service bus project" + services of 40 OSB projects
    The goal is that I have more than 40 projects to create and just the name of the projects that changes (when I say the name of the project ie the name of the OSB project, the name of proxy services and the name of business services ).
    So I want to give my script (ANT/Maven) the name of 40 OSB project and the script must generate the skeleton of the 40 projects at once time and after generation of skeleton of the 40 project, I will import them in the workshop to add manually mapping and routing and other things that differs from one project to another.
    So i want to generate automatically a skeletons of 40 OSB projects using a script (ANT / Maven) and I give to the script juste the names of the 40 projects.
    I want to create a "Oracle service bus configuration project" and "Oracle service bus project" automatically of 40 OSB projects (ANT or Maven or scripts) witch i can use after in workshop.
    I want to create one 'template' of all 40 projects in the same time, with the same directory structure (Transforlation, Business services, proxy services, WSDL .....) and all 40 project have the same transport, just the names of projects and services witch changes and i can give to the script all names of projects and services and i can give also all WSDL.
    Regards,
    Tarik

  • I have tried to view videos created in premiere elements 10 and I get the following message: "this file type is not supported, or the required codec is  not installed.  When it opens there is a red screen in the monitor panel with Korean writing which als

    I have tried to view videos created in premiere elements 10 and I get the following message: "this file type is not supported, or the required codec is  not installed.  When it opens there is a red screen in the monitor panel with Korean writing which also appears in the place of each clip in the video.  I tried uninstalling and reinstalling premiere elements 10, but that did not have any effect on the video.  Do you have any suggestions?  I researched codec, but do not understand them at all.

    gloucester
    In case you did not find it, the following is a copy/paste of the Announcement on Premiere Elements 19/NVIDIA GeForce
    that appears at the top of this forum.
    Premiere Elements 10 NVIDIA Video Card Driver Roll Back
    If you are a Premiere Elements 10 user whose Windows computer uses a NVIDIA GeForce video card and you are experiencing
    Premiere Elements 10 display and/or unexplained program behavior, then your first line of troubleshooting needs to be rolling
    back the video card driver version instead of assuring that it is up to date.
    Since October 2013 to the present, there have been a growing number of reports about display and unexplained workflow
    glitches specific to the Premiere Elements 10 user whose Windows computer has a NVIDIA GeForce video card. If this applies
    to you, then the “user to user” remedy is to roll back the NVIDIA GeForce video card driver as far as is necessary to get rid of
    the problems. The typical driver roll back has gone back as far as March – July 2013 in order to get a working Premiere
    Elements 10. Neither NVIDIA nor Adobe has taken any corrective action in this regard to date, and none is expected moving forward.
    Since October 2013, the following thread has tried to keep up with the Premiere Elements 10 NVIDIA reports
    http://forums.adobe.com/thread/1317675
    Older NVIDIA GeForce drivers can be found
    http://www.nvidia.com/Download/Find.aspx?lang=en-us
    A February 2014 overview of the situation as well as how to use the older NVIDIA GeForce drivers for the driver roll back can be found
    http://atr935.blogspot.com/2014/02/pe10-nvidia-video-card-roll-back.html
    ATR

  • Re: create material cost estimate with ck11n without

    hi gurus,
    i need to do create material cost estimate with ck11n without cost result but before i need to check the BOM with material component 11111, and also instruct me how to correct maintain BOM list to get the standard cost
    if anybody do the same scenoria giveme your golden inputs
    thanks in advance,
    kumar.b

    Hi,
    As note 351835 explains, calculation needs an inforecord to calculate prices from purchasing. Prices from outline agreements are generally not taken into account. According to note 499699, the system may consider entries in the source but it will ignore entered agreements (before this correction, any source list entries with agreement were ignored).
    Prices from agreements could only be considered either via a modification or by using the user exit for material valuation (COPCP005).
    This unfortuntely is a restriction resulting as a side-effect from note 499699. As soon as an agreement is entered in the source list, the fixed indicator will not be considered anymore.
    You therefore have two options to overcome this.
    1) You create a second source list entry without an agreement; then the fix indicator will be reflected; report Z_CREATE_EORD from note  409960 could be used to do this automatically
    2) You are using user-exit EXIT_SAPLMEQR_001 in order to 'overrule'   the standard search for source of supply (enhancement LMEQR001)
    regards
    Waman

Maybe you are looking for

  • Need Classes help......

    Hi all, i was wondering if anyone can help me out with my code. i've got a class Desktop, and a class menu. the class Desktop contains the following... public class Desktop extends JFrame implements ActionListener{ protected JDesktopPane  thedesktop;

  • Planned delivery Cost invoice verification via LIV EDI

    I have to verify the planned delivery cost in purchase order ( freight condition types). The invoice sent by the vendors via EDI ,have both material & freight cost. Unfortunately SAP doesnt allow to verify the planned freight cost via EDI. Is there a

  • How to edit a webdynpro JAVA application of ESS portal

    Hi, I have to work on a webdynpor JAVA app configurged in ESS portal,the app shows the salary slip of the employees,but don't have logo in it,so i am suppose to put logo there,but not able to understand how to start work on it. i have fair idea of We

  • PEAP Password Credential

    I have a Wireless network whit PEAP authentication, the authentication work fine, but I have this question: In the first login into the wireless the user enter the username and password created in the database local of the ACS,and the users is authen

  • Can't access my Verizon Cloud content.

    I'm trying to access my Verizon Cloud on my account and every time I click on it all it does is show a loading icon spinning until it finally times out. I've tried through firefox, chrome and explorer but still all the same thing. I have allowed all