How do I make a Grid layout?

Here should be an easy question for someone who knows Java, but for a newbee like me, it is difficult.
I'm using a tutorial with Eclipse as my platform. Wherever possible I'm using the visual editor to make my code.
The tutorial calls for Grid layout with 3 rows and 1 column. Eclipse says to right click on the graphic element and use Customize layout. This works, but Customize layout tells me "No layout options to customize on the current selection".
My question is: what do I need to add (manually?), in order to get the Grid layout?
Thanks,
Ilan
import javax.swing.JFrame;
public class FirstAppl extends JFrame {
     public static final long serialVersionUID = 1;     // needed for compiler
     public FirstAppl() {
          super();
          initialize();
      * This method initializes this
     private void initialize() {
        this.setSize(new java.awt.Dimension(171,100));
        this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
        this.setTitle("First Swing Application");
        this.addWindowListener(new java.awt.event.WindowAdapter() {
             public void windowClosing(java.awt.event.WindowEvent e) {
                  System.exit(0);
      * @param args
     public static void main(String[] args) {
          FirstAppl frame = new FirstAppl();
        frame.show();
}  //  @jve:decl-index=0:visual-constraint="10,10"

First of all, thanks for the reply, which did indeed help.
I pushed on, trying my best to use the visual editor if possible.
I failed in all attempts to drop the jButtons onto the jFrame.
The only way I could get it to work was to drop the jButtons onto the white area which wasn't being used. Then at least I could add an event via the visual editor, which was good. I don't know if this is possible, but if I could add a "ContentPane", then I could drop the buttons onto it. I see again and again that I need "getContentPane()". Is this possible, or do I have to wait until I know Java better to answer this one?
Thanks,
Ilan
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class FirstAppl extends JFrame {
     public static final long serialVersionUID = 1;     // needed for compiler
     private JButton jButtonTop = null;  //  @jve:decl-index=0:visual-constraint="59,180"
     private JButton jButtonBottom = null;  //  @jve:decl-index=0:visual-constraint="41,224"
     public FirstAppl() {
          super();
          initialize();
      * This method initializes this
     private void initialize() {
        this.setSize(new java.awt.Dimension(180,131));
        this.getContentPane().setLayout(new GridLayout(3,1));
        this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
        this.setTitle("First Swing Application");
        this.getContentPane().add(new JLabel("Swing components act like AWT"));
        this.getContentPane().add(getJButtonTop());
        this.getContentPane().add(getJButtonBottom());
        this.addWindowListener(new java.awt.event.WindowAdapter() {
             public void windowClosing(java.awt.event.WindowEvent e) {
                  System.exit(0);
      * This method initializes jButtonTop     
      * @return javax.swing.JButton     
     private JButton getJButtonTop() {
          if (jButtonTop == null) {
               jButtonTop = new JButton();
               jButtonTop.setText("Top");
               jButtonTop.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent e) {
                         System.out.println("top");
          return jButtonTop;
      * This method initializes jButtonBottom     
      * @return javax.swing.JButton     
     private JButton getJButtonBottom() {
          if (jButtonBottom == null) {
               jButtonBottom = new JButton();
               jButtonBottom.setText("Bottom");
               jButtonBottom.setSize(new java.awt.Dimension(75,26));
               jButtonBottom.addActionListener(new java.awt.event.ActionListener() {
                    public void actionPerformed(java.awt.event.ActionEvent e) {
                         System.out.println("bottom");
          return jButtonBottom;
      * @param args
     public static void main(String[] args) {
          FirstAppl frame = new FirstAppl();
        frame.show();
}  //  @jve:decl-index=0:visual-constraint="10,10"

Similar Messages

  • How can I make the GRID lines more bold within a table in the new Pages?  (Not the outline of a table)

    I can't find where to darken GRID lines on a table in the new Pages.  I can make the outline more bold, but not the grid lines within the table.  Is there a way to do this?  The default grid lines are far too faint.

    Yeah, the Help is missing a little.
    If you select the block of cells that you want to change, then in the Format inspector:
    Select the Cell tab
    Expand the Border section
    Set a line type
    Set a line width
    Choose a line color
    Choose one of the nine options for which borders get the new settings

  • How can I make a fixed layout illustrated ebook using indesign?

    I ave the book ready in Indesign and I have successfully exported it in pdf, but there seems no way to turn it into a successfull kindle format book or a working epub. Everything moves around and the images get small. I am using creative cloud, the amazon pugin does not work and I don't know how to proceed.

    Creating fixed layout ePub books is quite complex. This new book might help:
    http://www.amazon.com/Creating-Fixed-Layout-eBooks-ePublishing-InDesign-ebook/dp/B00BLTVDC I/ref=sr_1_2?ie=UTF8&qid=1391081316&sr=8-2&keywords=pariah+burke
    Derek

  • How can I make grid lines in ICAL darker?

    How can I make the grid lines darker in I CAL ?

    Numbers on ipad does not give you the option of adding trend lines to your graphs at this time.
    Jason

  • How can I make a part of the body of my content full width of the screen with a fluid grid layout in CSS? (In dreamweaver program)

    How can I make a part of the body of my content full width of the screen with a fluid grid layout in CSS? (In dreamweaver program)
    and I know it is being over-ridden by
    .gridContainer {
      width: 88.5%;
      max-width: 1232px;
      padding-left: 0.75%;
      padding-right: 0.75%;
      margin: auto;
      clear: none;
      float: none;

    Abdelqader Alnobani wrote:
    How can I make a part of the body of my content full width of the screen with a fluid grid layout in CSS? (In dreamweaver program)
    and I know it is being over-ridden by
    .gridContainer {
      width: 88.5%;
      max-width: 1232px;
      padding-left: 0.75%;
      padding-right: 0.75%;
      margin: auto;
      clear: none;
      float: none;
    Logically a structure something like below should work BUT whether or not it will upset the FG I don't know as I wouldn't ever use it.
    <div class="gridContainer">
    Top Code Section Goes Here
    </div>
    <!-- close gridContainer -->
    <div id="fullWidth">
    Full width section goes here
    </div>
    <!-- close fullWidth -->
    <div class="gridContainer">
    Bottom Code Section Goes Here
    </div>
    <!-- close gridContainer -->

  • How can I convert my web page from a fixed width layout to a fluid grid layout?

    I'm taking a web design class (I'm using Dreamweaver CS6, btw)  wherein the professor started us out building our websites in a fixed width layout but now I want to change my site into a fluid grid layout. My "site" so far is just one long page, and I've already designed it with fluid grid adjustments in mind (most things are centered  in the layout) so it shouldn't need excessive tweaking.
    Is there a way to duplicate the site folder that holds my first page, re-open a new document in fluid, then copy the code in and tweak the width parameters for the different layouts?
    Did I just answer my own question? Help - I am new at this!!
    Thanks all,
    KC

    Herbert2001 wrote:
    A bit off-topic, but Osgood: have you ever used SASS or LESS? When you are building your own grid systems it can save you a tremendous amount of time, and it's a lot of fun.
    Take the following simple example - it generates all the 23 css classes automatically for a 12 grid system. And simply changing one variable allows you to create and calculate any number of columns!
    //variables
    $desktop: 1025px;
    $large-columns: 12;
    @media only screen and (min-width: $desktop) {
         //regular grid span classes
        @for $i from 1 through $large-columns {
            .span-large-#{$i} {
                width: percentage($i/$large-columns);
         // push classes
        @for $i from 1 through (($large-columns)-1) {
            .push-large-#{$i} {
                margin-left: percentage($i/$large-columns);
    No, not explored it yet, and may never....I don't know. I don't really make much money out of web design. It's becoming more and more difficult to find the desire to learn new techniques when the opportunities aren't really there to put them into practice on as regular basis as I would like.  I've got  a very good handle on css, php, html, jQuery - I'm not sure I want to add another layer at the moment, given I'm never quite sure how long I will continue to 'bang my head against the wall' . I'm getting to the stage where I keep asking myself do I really need the problems associated with learning new stuff to the point of being comfortable with it if the financial rewards at the end don't equate to the efforts of learning it.
    I don't really enjoy web development if truth is known. I come from a Graphic Design background which I much prefer but somehow got side tracked and pushed in this direction and there's no way back now, lol. Whilst I concede Web Development is much more exciting its also 100 times more complex/difficult and the skills needed are considerably more.
    Your example looks interesting and I should think I could pick it up reasonably easily given I work with php which uses variables on a similar basis.

  • NetBeans 5.5. + layout - how can I make a jar?

    1. I try to build my application.
    2. I've developed it in NetBeans 5.5
    3. I ve used form as a base for my GUI
    4. I've made application with help of GUIBuilder+some swing components I create dynamically during program execution.
    The problem:
    I can't make runnable JAR.
    When I try to launch project.jar form folder /dist I get message:
    "No main class found"
    I need to have these jars (they are in my project's library section:
    1.swing-layout-1.0.1.jar
    2. AbsoluteLayout.jar
    I found a solution:
    How can I package the swing-layout-version.jar library
    into my application JAR?
    Having developed your Swing application in Matisse (using the "Free Design" layout) you can
    package the required swing-layout-version.jar library inside your application JAR file.
    Requirements:
    &#9679; Standard Java project
    &#9679; Swing Layout Extensions library included in your project's classpath
    Open your project's build.xml from the Files tab and insert this:
    <target name="-post-jar">
    <jar update="true" destfile="${dist.jar}">
    <zipfileset src="${libs.swing-layout.classpath}"/>
    </jar>
    </target>
    Just press F11 to build your project as usual. This Ant target will bundle swing-layout.jar
    inside your distribution JAR file.
    You can adapt this Ant target to different requirements.
    So I've inserted this code into my build.xml
    Size of built project jar file increased.
    I try to lauch it and I get no message. Nothing happens.
    What else I have to do if I want to get distributable jar....?

    So I found a problem.
    Jar with main class created using GUIBuilder (NetBeans) doesn't launch.
    I use netbeans 5.5. + jdk 1.6.
    If I launch jar with frame-based main class - everything works.
    If I try to launch form-based main class - it doesn't work.
    I do not get any error message or something like that.
    What it can be?

  • How to setup a default direction for new divs in fluid grid layout in dreamweaver?

    Hi,
    how to setup a default direction for new divs in fluid grid layout in dreamweaver? I am an RTL interface user, I need my new divs to be inserted from right to left not Left to Right! could it be in dreamweaver?
    Thanks.

    This may get me into strife, but my experience is that you are better off finding another platform for your RWD.
    The framework that I tend to use is by Zub-Foundation http://foundation.zurb.com/.
    A commercial product that I have come to appreciate can be found here http://www.projectseven.com/products/tools/composer/index.htm. Please do not mention me if you happen to choose this product.

  • How to setup a default size for new divs in fluid grid layout in dreamweaver?

    Hi,
    how to setup a default size for a new divs in fluid grid layout in dreamweaver? I don't need the default size for new divs as a 100% width, I need them 13.69% as a one coulmn width only (7 coulmns fluid grids layout for desktop size 1000w).
    This problem I've faced when I intended to insert dozens of fluid grid divs in the layout.

    Sorry, I don't believe that you have had a good look at the Foundation framework. I'll now hold your hand while we go through the basics.
    Here is the specific page http://foundation.zurb.com/docs/components/grid.html
    The default values are
    Em-base : 16px
    Row width: 62.5em (62.5em x 16px = 1000px)
    Columns per row: 12
    These and other default values can be changed. The fact of the matter is that if you stipulate a section width of 2 or 3 or 12 columns, the widths will automatically be calculated for you.
    In your case, if you want 7 columns, all you need to do is change the number of columns per row and the rest is done for you.

  • How do you make this type of grid?

    This is a very very very simple question, I was wondering how you would lay a grid flat back like this:
    http://cbu2029.deviantart.com/art/Cyberpunk-City-61614863
    I have the grid made, with tthe grid tool. I tried shear tool and that doesn't seem to get me there and I tried the free distort tool but that does not make it precise.
    I know there is some way to grab the top two corners and pull them down and in closer but I am drawing a blank on what it is right now, please help if you can.

    Simply apply the group to a perspective grid or create a warp with a simple rectangle as the envelope.
    Mylenium

  • How to increase the width of the Fluid Grid Layout from 1008px to 1080px?

    Good day all, I'm experiencing a slight problem with Fluid Grid Layout in Dreamweaver CS6. I want to increase it's width so that it could be one with my Photoshop CS6 design (which is 1080px), the problem is that I can't as I am limited to 1008px. How do I increase the width? I ultimately am re-coding my design as my client demanded a responsive design but I'm clueless in that avenue which is why I resorted to re-doing everything under the set & safe default (Fluid Grid Layout) that doesn't require me to udnderstand media queries at an expert level.  

    While Fluid Grid Layout can save you some production time, you still need a good understanding of CSS Media Queries to use it.
    Introduction to CSS Media Queries
    http://www.adobe.com/devnet/dreamweaver/articles/introducing-media-que ries.html
    CS6 Fluid Grid Layouts (6 min video)
    http://tv.adobe.com/watch/digital-design-cs6/creating-adaptive-designs -using-fluid-grid-layouts-in-dreamweaver-cs6/
    CS6 Fluid Grid layouts (17 min video)
    http://tv.adobe.com/watch/learn-dreamweaver-cs6/using-fluid-grid-layou ts/
    Step-by-Step tutorial -- Building Fluid Grid Layouts in DW CS6
    http://www.adobe.com/inspire/2012/08/fluid-grid-layouts-dreamweaver-cs 6.html
    Instead of fixed-widths in pixels, FLG code is all % based.  It starts with the mobile layout and cascades to tablet, then desktop.  If you want to use fixed-widths in pixels, you must manually change the CSS code for all three devices.
    Nancy O.

  • DW CC Fluid grid layout how to change px width for desktop layout

    Hi there,
    I have been going through the various tutorials about fluid grid layout and setting up our bureau's website in a responsive layout.
    The width of the original design was 960 px and the hero pic and others have been exported at that size.
    The first divs in the design look fine, header with the 960 px pic in it, and also the BC menu which is set to 960 wide.
    However the body text goes out to the right, past the 960 px and this is because, right at the start, when starting the file in DW the desktop screen width is set to 1232px.
    How can you change this setting when starting a new fluid grid layout?
    I have tried changing the number of columns, or the percentage, and the width for desktop remains at 1232px.
    Why is this?
    Not all of our clients want a site 1232px wide on a pc.
    Thanks so much.

    Hi Ben and Nancy,
    Thanks for your replies, but maybe you both don't realise I am asking specifically about DW CC and setting up a responsive design using a fluid grid layout?
    I have been following the recent videos from Adobe on this.
    As far as the width of 960 goes, Nancy I am only shortchanging myself, as this is the website for our agency. The original design is 960px wide as I did read somewhere that this width is recommended now that responsive is coming, as it is easily divided into a grid layout. I also am quoting for a client at the moment who wants a responsive design for their website, and they have specifically requested that the site have a maximum width of 960 px. So I would like to find out if this is possible in DW CC at the moment when doing a fluid grid layout.
    So what I am trying to do here is follow the Adobe tutorials on responsive design, using DW CC and I am using the current design for our agency website as a trial to set this up and try and get it working as a responsive website.
    It does not seem to me that many other people are doing this, as most people are recommending that I try Github or Bootstrap.
    However, I am not a coder and I am used to using DW, so I would like to get the DW CC responsive design features working if possible.
    Ben the CSS you are looking at is being generated by DW CC as I follow the steps in the Adobe demonstration videos to set up a fluid grid layout in DW CC.
    One of the things they say in the videos is that you can't program the CSS directly when doing a fluid grid layout, or you break the CSS and it all stops working. So I am using the new panels in DW CC to set up the layout. One thing I cannot get access to is the ability to set a maximum width for the site. It seems to be set in concrete when you start the fluid design up in DW CC.
    Here is a pic of the screen I am talking about that sets the maximum width:
    I cannot click in the pixel width at the top and change it. Also if I adjust the number of gridlines or the percentage for the pc layout, the default maximum pixel width does not change.
    If you click on the preferences button and go into the Window sizes screen, there does not seem to be a way to set the maximum pc width here either, so I am a bit stumped.
    Maybe I just have say to my clients that if you want a responsive design then the max width for pc can only be 1232px? It does seem strange to me that this cannot be changed.

  • How do I make categories under My Templates, as is done in page layout and word-processing?

    How do I make categories under My Templates, as is done in page layout and word-processing? I have over 50 of my own templates and want to categorize them. For example: son's homework, business, etc. Thanks

    Here are some screenshots of my organization. Your sub-folders need to be in the same folder as My Templates, NOT in My Templates which is confusing.

  • In Fluid Grid layout, I have hidden 2 div for mobile layout. How do I unhide them?

    In Fluid Grid layout, I have hidden 2 <div> for mobile layout. How do I unhide them?

    Hi there,
    I visited your site using Dreamweaver CC and tested it using the default Desktop, Tablet and Mobile sizes, followed by the Smart Phone Size.
    The CSS you currently have sets the featurest <div> to 'display: none' when viewed on screen sizes lower than 480px:
    Another helpful way to find out what is going on with your CSS is to test the site with Firefox using Web Developer Tools to inspect the element (or alternatively, Adobes Inspect tool). You can right-click the image and "Inspect Element" then resize the browser window so you can see exactly which CSS rule is being applied and overrided.
    My suggestion would be to add an additional media query in Dreamweaver to handle all screen sizes below 480px and then set divs or elements you want to hide or show display property to visible.
    Hope this helps!

  • How to convert live website to fluid grid layout

    I have an existing live website. How do I convert it to a fluid grid layout?

    Who is Peter?
    Responsive Web Design
    http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/
    Introduction to CSS Media Queries
    http://www.adobe.com/devnet/dreamweaver/articles/introducing-media-queries.html
    CS6 Fluid Grid layouts (17 min video)
    http://tv.adobe.com/watch/learn-dreamweaver-cs6/using-fluid-grid-layouts/
    Creative Cloud 12.2 Enhancements to Fluid Grid Layouts
    http://blogs.adobe.com/dreamweaver/2013/02/updated-fluid-grids-in-dreamweaver.html
    Step-by-Step tutorial -- Building Fluid Grid Layouts in DW CS6
    http://www.adobe.com/inspire/2012/08/fluid-grid-layouts-dreamweaver-cs6.html
    If you want to support multiple languages, you'll need to build a mirror site with translations.
    Nancy O.

Maybe you are looking for

  • Is there any way to back up imessages

    I've recently experienced the problem of the "other" category in my storage bar taking up 17.04 GB. I'm assuming that this means that there is some corrupted data in there somewhere as I've gone and deleted a bunch of emails, and photos, etc. with no

  • Customer Balances in Local currency

    Hi Gurus, Can some one explain me about TCode-  S_ALR_87012172= Customer balance in Local currency It importance ,its benefits, Thanks, Seegal

  • Embedded links in Mail

    I have a circulation list of some 150 or so addressees to which I send a newsletter from time to time, and I use an Address Book group to achieve this. So far so good. However, I have a problem, or at least some of my recipients appear so to do. Not

  • Support Pack upgrade path

    We recently upgraded from ECC 6.0 support pack 9 to support pack 15. At the same time, we installed EHP4 support pack 5. A few questions: 1. Will we upgrade our ECC 6.0 support pack 15 system to the next support pack, for example  to support pack16 o

  • ITunes - Library Updating en masse

    Hi... I recently purchased an IPod Classic. I had previously converted all of my CD's into an MP3 format on my computer. When I added them to the ITunes library, some of the data, such as, artist, genre, etc., is missing, misspelled, incorrectly labe