Grid within a grid

Hi,
I am new to awt. I am trying to create a series of grids within a grid.
The first grid will have three rows and one column. Each of the rows will contain a grid of varying numbers of rows and columns.
Has anyone an example of how I would do something like this (no swing please, I haven't got to that part of Java yet!)
Cheers,
Didje

Hi,
Yes, that's where my problem has been. I've never done containers before, so I've been figuring how to nest them.
However, I have managed to cobbble the following code together, which basically works, but I can't figure out how to reduce the size of the top and bottom buttons to a similar size of the centre buttons.
import java.awt.*;
public class NestedPanel extends Frame {
public NestedPanel(String title) {
super(title);
setLayout(new GridLayout(3,0,0,40));
     addPanel1();
     addPanel2();
     addPanel3();
public void addPanel1() {
     Panel panel = new Panel();
     panel.setLayout(new GridLayout(0,3,15,30));
panel.setSize(10,10);
     panel.add(new Button("TButton X"));
     panel.add(new Button("TButton Y"));
     panel.add(new Button("TButton Z"));
     add(panel);
public void addPanel2() {
     Panel panel = new Panel();
     panel.setLayout(new GridLayout(4,5));
for(int i=1;i<=20;i++)
          panel.add(new Button("Button " + i));
     add(panel);
public void addPanel3() {
     Panel panel = new Panel();
     panel.setLayout(new GridLayout(0,4,15,30));
     panel.add(new Button("BButton X"));
     panel.add(new Button("BButton Y"));
     panel.add(new Button("BButton Z"));
     panel.add(new Button("BButton Q"));
     add(panel);
public static void main(String[] args) {
NestedPanel abc =
new NestedPanel("Nested Panel");
     abc.setSize(350, 550);
     abc.setVisible(true);     
}

Similar Messages

  • Bulleted List within a Grid Panel

    Hi,
    I'm trying to format an HTML page, using the Grid Panel component to arrange various text and images.
    In one of the text sections I need a bulledted list, but can't seem to find a way to do that, within the Grid Panel.
    I need this page to be a JSP page, as it is going to be dynamic.
    All help/advice would be appreciated.
    Regards
    Haroon

    Hi Haroon,
    Please go through the below jsp code to get a bulleted list in a grid panel
    <h:panelGrid binding="#{Page1.gridPanel1}" id="gridPanel1" style="left: 48px; top: 48px; position: absolute">
                            <ul>
                                <li>One</li>
                                <li>Two</li>
                                <li>Three</li>
                            </ul>
                        </h:panelGrid>Hope this helps
    Cheers
    Giri

  • Data grid within advanced data grid (Hiding and showing columns)

    Hi,
    I have a dta grid within advanced datagrid. When the row of advanced data grid is expanded, the datagrid opens up.
    I want to control the columns of datagrid based on the value of a field in advanced data grid. I want to show all the columns of the datagrid if the field value of advanced data grid is "X" else I want to show only few columns of the data grid.
    I will set the id for all the columns of the datagrid. Then I think I can write some code in a method to set the visibility of the columns and assign the function to item opening property of the advanced data grid.
    Please give me some ideas.
    Regards,
    Mahee   

    Hi,
    Please go through following links:
    http://www.cflex.net/showFileDetails.cfm?ObjectID=553
    http://flexmusings.wordpress.com/2009/08/03/hide-row-column-datagrid/
    http://www.java2s.com/Code/Flex/Grid/HidinganddisplayingDataGridcolumns.htm
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Example of using ActionScript to create Grid, GridRow, and Grid Item?

    Does anyone know where I can find a complete example of using
    ActionScript to create Grid, GridRow, and Grid Item?
    I got an error when trying to add a child to the GridRow.
    Flex 2 said this method (addChild) is not available to
    GridRow.

    This thread should help:
    http://www.actionscript.org/forums/showthread.php3?t=167806
    matt horn
    flex docs

  • Tools- FP Grid Default panel grid size (pixels) does nothing

    Hi all,
    LV 2013 SP1
    I want to set up FP grid of 5 x 5 pixels.
    When I go to LV Tools -> Options FP Grid Default panel grid size (pixels) and change to 5 pixels it does nothing.
    The FP still uses 12 sq pixel grid even when I restart LV.
    Does this happen to others?  Am I doing something wrong?
    Thanks.
    Solved!
    Go to Solution.

    Hi battler,
    what happens when you open a new VI after changing the grid settings?
    Those changes do not apply to old VIs as is written in the LabVIEW help here!
    Read the LabVIEW help also here…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to make a field manadatory within ALV Grid using methods and classes

    Hi,
    I am using ALV Grid using set_table_for_first_display
    inside my dialog programming. I have a field called project number inside my grid which has to be made as mandatory field.
    I have defined a method called catch_data_changed inside my class lcl_event_receiver. This method captures the changes made to one of the fields inside my ALV grid and displays all the default values of the other fields from the grid.
    Now, i have to make project number which is one of my fields inside my ALV grid as mandatory. At the field catalog level i did not find any such option for making a field as required field.
    Is there any other way, i can accomplish this within the ALV grid?

    from my understanding from ur question, i understood that u want the editable field inside alvgrid to be mandatory.
    i dont know anthing in fieldcat, but u can try the following logic.
    FORM DATA_CHANGED  USING P_ER_DATA_CHANGED TYPE REF TO
    CL_ALV_CHANGED_DATA_PROTOCOL .
      DATA: L_VALUE TYPE LVC_VALUE,
        ls_mod_cell type lvc_s_modi.
      READ TABLE P_ER_DATA_CHANGED->MT_MOD_CELLS INTO LS_MOD_CELL.
    if sy-subrc = 0.
        CALL METHOD P_ER_DATA_CHANGED->GET_CELL_VALUE
          EXPORTING
            I_ROW_ID    = LS_MOD_CELL-row_id
            I_FIELDNAME = LS_MOD_CELL-fieldname
          IMPORTING
            E_VALUE     = L_VALUE.
    IF LS_MOD_CELL-FIELDNAME <> 'fieldname what u want'
    MESSAGE 'ENTER VALUE INTO (fieldname u want) ' TYPE 'I'.
    ENDIF.
    ELSE.
    MESSAGE 'ENTER VALUE INTO (fieldname u want) ' TYPE 'I'.
    ENDIF.

  • Is it possible to use HTML5 tags within fluid grid layouts?

    Hello,
    I want to build my future websites with fluid grid layouts and Dreamweaver CS6 but I don't find any help by searching the internet how I could use the HTML5 tags like "header" "nav" "footer" etc. within the fluid grid layouts automaticly. If I do anything manually it's more error-prone. Or is just the best way to stay with the "normal" div-tags???
    Thank you in advance, best regards ... Björn

    Those tags are equal to a normal DIV and can be used just the same, they are just not built into CS6.
    Mylenium

  • How to display variable lenght grid within subreport

    Hello;
    In order to compensate and fill up space of a subreport to make up a full page or even generate a blank page to compensate for duplex printing, we have programmed the data to fill in blank records, as many as we need per invoice. These invoices have variable pages, due to many transactions.
    The idea is to be able to draw grid, lines between the transaction within the subreport but we can't. The reason is because the data is populating blank lines and we only would like to show the grid over the populated fields.
    Is there any control or option in Crystal to control this or handle it some other intelligent way?
    Thanks again!

    hi Nikolay,
    have a look at the attached report. extract the contents and change the .txt extension to .rpt.
    there is a formula there that replicates lines based on the number of lines needed in total less the count of existing records. the formula is also Formatted to Can Grow. the Details B section also has Suppress Blank Section checked so that it doesn't show up when the formula is empty.
    -jamie

  • Entering text within sections of a Polar Grid within illustrator.

    I have created a polar grid in illustrator with many sections. I want to be able to enter text in every section of the grid and not just along the path lines. How do i create text frames so each grid section within the polar grid is separate and therefore allows me to click on it and enter text. I would also like to change the colour of all the polar grid sections individually. I think it might have something to do with threaded text but not sure. Once i have created frames for each section I assume this will allow me to do this. Please can someone explain how i can resolve this problem. Thank you in advance.

    bodydhillon.
    You may (Smart Guides are your friends):
    1) Create the Polar grid with twice as many Radial Dividers as you wish to end with; the surplus ones are for Path Type;
    You may Ungroup and work with the Selection Tool for selection, or work with the Direct Selection Tool for selection in the following;
    2) If you only wish to have text in some of the segments round the grid delete the rest, the unwanted dividers;
    Either:
    3) Select the Concentric Divider outside the segments to have text (if you Direct Select it, click it in the layers palette to select the whole path, then Object>Path>Divide Objects Below; repeat for the Concentric Divider inside the segments to have text;
    Or:
    3) Cut each of the surplus dividers with the Scissors Tool at the bordering Concentric Dividers (Smart Guides say intersect when you are there);
    4) Delete the unwanted parts of the surplus Radial Dividers that are outside the segments to have text (with the Direct Selection Tool you have to delete twice to get rid of the end points);
    5) Select all the paths for the Path Type and Object>Path>Add Anchor Points;
    6) Select each of the paths from 5 where the Type is to go outside in and rotate by 180 degrees (Object>Transform>Rotate);
    7) Set Paragraph>Align Center, then select the first path, then click the midpoint with the Path Type Tool and type the first bit, then use the Character>Baseline Shift to get it centred over the baseline;
    8) Type the other bits in the same way (the baseline shift will work for them as well).

  • Drag Image Order within in Grid View or on Filmstrip

    Sure would be nice to to be able grab an image or group of images and drag them to a new location in the grid or filmstrip and be able to drop them there. I thought the whole idea was to be able to make it simple for arranging a slideshow, or organizing images in an order deemed logical to the photographer. Stacks accomplish some of this functionality, but not enough.
    -David

    The best way to do a slideshow is to select all the images to be used and make a Quick COllection or Collection from them. Then one can drag and drop re-order the images in the FIlmstrip or grid for a slideshow.o
    Such sorts can not be done in All Photographs, only in a Collection or single Folder (not a Parent). The problem for this in a Folder is all the images for the Slideshow have to be in the same folder and you end up using the whole folder not just some o fht eimages if you don't want all of them.
    Bst to just make a Collection for a Slideshow. Sliedshow even remembers the settings for that Collection even if you don't create a preset.
    Don
    Don Ricklin, MacBook 1.83Ghz Duo 2 Core running 10.4.10 & Win XP, Pentax *ist D
    http://donricklin.blogspot.com/

  • Can you reference another file within a grid in financial Reporting Studio.

    I'm trying to calculate % of Revneue with in grid. Rather than making the file larger by adding another grid with the Revenue values, I'd like to know if there's a way to reference another file which already includes the revenue data. Thanks

    My issue is that the spreadsheet won't fit on a page - it's several worksheets and the margins aren't the same. What I'd like to do is imbed the numbers (or excel or pfd or jpg) icon as part of a summary paragraph. If the reader wants to see the spreadsheet/document/photo, he/she can click on it and open the spreadsheet (or pdf file). I've done this with LotusNotes (yes, I'm dating myself) and believe that it can be done in Word. So I am hopeful that there is a way to do it in Pages.

  • Passing Struct To CFC Within A Grid Bind

    Why does the following not work? When trying to pass the
    struct it gives me the error "Complex object types cannot be
    converted to simple values." Can I not pass structs within binds to
    a CFC? Obviously in this example i'm only passing a single numeric
    value, but what I really want to do is pass a full struct that
    contains a list. If there's an easier way to pass a list, that
    works too!

    cf has a nice listchangedelims() function - you can change
    the list
    delimiter from comma to, say, | (pipe), and in your cfc
    either specify
    pipe as delimiter in any list functions you use or change it
    back ot
    comma using the same function.
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • How to move a selected row data from one grid to another grid using button click handler in flex4

    hi friends,
    i am doing flex4 mxml web application,
    i am struck in this concept please help some one.
    i am using two seperated forms and each form having one data grid.
    In first datagrid i am having 5 rows and one button(outside the data grid with lable MOVE). when i am click a row from the datagrid and click the MOVE button means that row should disable from the present datagrid and that row will go and visible in  the second datagrid.
    i dont want drag and drop method, i want this process only using button click handler.
    how to do this?
    any suggession or snippet code are welcome.
    Thanks,
    B.venkatesan.

    Hi,
    You can get an idea from foolowing code and also from the link which i am providing.
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    width="613" height="502" viewSourceURL="../files/DataGridExampleCinco.mxml">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.binding.utils.BindingUtils;
    [Bindable]
    private var allGames:ArrayCollection;
    [Bindable]
    private var selectedGames:ArrayCollection;
    private function initDGAllGames():void
    allGames = new ArrayCollection();
    allGames.addItem({name: "World of Warcraft",
    creator: "Blizzard", publisher: "Blizzard"});
    allGames.addItem({name: "Halo",
    creator: "Bungie", publisher: "Microsoft"});
    allGames.addItem({name: "Gears of War",
    creator: "Epic", publisher: "Microsoft"});
    allGames.addItem({name: "City of Heroes",
    creator: "Cryptic Studios", publisher: "NCSoft"});
    allGames.addItem({name: "Doom",
    creator: "id Software", publisher: "id Software"});
    protected function button1_clickHandler(event:MouseEvent):void
    BindingUtils.bindProperty(dgSelectedGames,"dataProvider" ,dgAllGames ,"selectedItems");
    ]]>
    </mx:Script>
    <mx:Label x="11" y="67" text="All our data"/>
    <mx:Label x="10" y="353" text="Selected Data"/>
    <mx:Form x="144" y="10" height="277">
    <mx:DataGrid id="dgAllGames" width="417" height="173"
    creationComplete="{initDGAllGames()}" dataProvider="{allGames}" editable="false">
    <mx:columns>
    <mx:DataGridColumn headerText="Game Name" dataField="name" width="115"/>
    <mx:DataGridColumn headerText="Creator" dataField="creator"/>
    <mx:DataGridColumn headerText="Publisher" dataField="publisher"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:FormItem label="Label">
    <mx:Button label="Move" click="button1_clickHandler(event)"/>
    </mx:FormItem>
    </mx:Form>
    <mx:Form x="120" y="333">
    <mx:DataGrid id="dgSelectedGames" width="417" height="110" >
    <mx:columns>
    <mx:DataGridColumn headerText="Game Name" dataField="name" width="115"/>
    <mx:DataGridColumn headerText="Creator" dataField="creator"/>
    <mx:DataGridColumn headerText="Publisher" dataField="publisher"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:Form>
    </mx:Application>
    Link:
    http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/ae9bee8d-e2ac-43 c5-9b6d-c799d4abb2a3/
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Move JS Grid control Pivoted grid to Left side

    Hi Everyone,
    i have implemented JS Grid in my custom application page to display SharePoint list data in tabular fashion and i have enabled the Pivoted grid pane,by default the pivoted grid pane will be displayed on the right
    side but my requirement is to display the  pivoted grid pane on the left side as shown below.

    There are not so many information explaining how to customize JS Grid control,can someone guide me on this.

  • Setting Up Rectangular, for example 16:9 with different subdivisions, Grid (View Show Grid)

    The Grid tool (View > Show Grid) is a huge help when designing. Unfortunately, by default AI allows us to specify only square grids, i.e. you set one parameter for gridline spacing (and one for its subdivisions) and AI creates square grid applying your value for both: horizontal and vertical directions. But what if we need something more, for example 16:9 proportion grid (subdivided into 4 parts in horizontal direction and 3 in vertical)? Hmm…. actually… we can do this! We can even set different colors for the main and subdivision lines:
    Full tutorial available here: Setting Up Rectangular and Colored Grid in Adobe Illustrator
    Maybe someone will find it useful.
    Regards,
    Pawel Kuc

    Found something on this! The rectangular grid with different vertical and horizontal subdivision values can be set!!! We can even set different colors for the main and subdivision lines. I've tested this under Mac (CS6 and CC) and Windows x86 and x64 (CS6, CC). I've posted a short articale on this:
    Setting Up Rectangular and Colored Grid in Adobe Illustrator
    I hope somene will find it useful
    Regards,
    Pawel Kuc

Maybe you are looking for

  • Error while migrating query

    Hi All, In our project, we have several queries which were created in Bex 3.x version. While migrating them to 7.0 version i got the error which is shown below, many a times Errors: BEx transport request" is not available or not suitable. Errors: Cho

  • Control delivery type for mvt type 313

    Hi Regarding SLOC to SLOC transfer postings, I have a couple of questions: Using movement type 313 (unr. use stock SLOC to SLOC) in our SAP system automatically creates a delivery in the background. Where can I configure what delivery type I would li

  • Has anyone tried to download Rosetta Stone to their iPad?  Can it be done?

    I'm going to be on an overseas flight and thought I'd learn Spanish during the 13 hours. 

  • How do I get files from mac to ipad

    Just brought IPAD Mini and can't get my documents to sync over. Have Microsoft Office 2011 for MAC. thomasdc28

  • Disk Fix via FW to another Mac

    I haven't been able to boot my PB since trying to upgrade from Panther to Leopard. I access the PB hard drive as a FW drive on a Mac Pro, and I've run disk utility on the drive numerous times. It says the drive is OK, but I still can't boot. Here's m