GUI Layout - HELP!!!! :)

Hi, for some reason, i have created many frames but this particular one displays the title (information) puts a jbutton next to it and then 2 more underneath and 2 more under that. I wanted it sort of list form where title appears at top then 2 next row and 2 next. hpe u get me, the code used is below
public InformationGUI() {
          super("Information");
          Label title = new Label(" INFORMATION", JLabel.CENTER);
          font = new Font("Ariel", Font.BOLD, 20);
          title.setBackground(Color.red);
          title.setFont(font);
          viewinfo= new JButton("view");
          viewinfo.addActionListener(this);
          addinfo = new JButton("add");
          addinfo.addActionListener(this);
          deleteinfo = new JButton("delete");
          deleteinfo.addActionListener(this);
          amendinfo= new JButton("amend");
          amendinfo.addActionListener(this);
          back = new JButton("GO BACK");
          back.addActionListener(this);
          Container contentPane = this.getContentPane();
          contentPane.setLayout(new BorderLayout());
          this.setBackground(Color.blue);
          contentPane.setLayout(new GridLayout(5,1,5,1));
          contentPane.add(title);
          this.setLayout(new GridLayout(5,2));
          this.add(addinfo);
          this.add(viewinfo);
          this.add(deleteinfo);
          this.add(amendinfo);
          this.add(back);
          this.pack();
          this.setVisible(true);
          ClosingWindow close = new ClosingWindow();
          addWindowListener(close);
     }

Note that the below won't make much sense unless you actually
go through it and read the relevant API documentation.
Learn to fish!
If I were going to write your code, I'd do it like this:
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
public class InformationView {
    public static void main(final String[] argv) {
        final JFrame mainFrame = new JFrame();
        new InformationView(mainFrame.getContentPane());
        mainFrame.pack();
        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mainFrame.setVisible(true);
    public InformationView(final Container container) {
        // Set background color
        container.setBackground(Color.GREEN);
        // Add title to container
        final JLabel info = new JLabel(" INFORMATION", SwingConstants.CENTER);
        info.setBackground(Color.GREEN);
        info.setFont(new Font("Arial", Font.PLAIN, 10));
        container.setLayout(new BorderLayout());
        container.add(info, BorderLayout.NORTH);
        // Add buttons to container
        final JButton addButton = new JButton(new AddAction());
        final JButton deleteButton = new JButton("Delete");
        final JButton viewButton = new JButton("View");
        final JButton amendButton = new JButton("Amend");
        final JButton backButton = new JButton("Back");
        final JPanel buttonPanel = new JPanel(new GridLayout(3, 2));
        buttonPanel.add(addButton);
        buttonPanel.add(deleteButton);
        buttonPanel.add(viewButton);
        buttonPanel.add(amendButton);
        buttonPanel.add(backButton);
        container.add(buttonPanel, BorderLayout.CENTER);
    public class AddAction extends AbstractAction {
        public AddAction() {
            super("Add");
        public void actionPerformed(final ActionEvent ae) {
            // Add functionality here
}

Similar Messages

  • Creating a purchase order form that has a flowable layout" Help Tutorial

    Regarding the "Creating a purchase order form that has a flowable layout" Help Tutorial,  I can't seem to get the data to pull in for just the PO in question, is there a secret?
    Ideally, it should create one form for each PO with the detail lines for each PO on the individual forms.  Can we do this?
    Many thanks!

    Hi
    If the smartform purchase order is not available in your system
    means you can download the form IDES and you can upload the form in ur ecc 6.0 system.we faced a similar kind of problem in our system and we did as i said.
    Once you uploaded the things you can easily view the form interface and rest of the things related to smartforms.
    Thanks and Regards
    Arun Joseph

  • Help with GUI Layouts and ContentPane

    Hi all,
    I need a little help.. I am writing a program to display a window with different widgets,
    This is how it's layed out: (picture a window in your head):
    Text Field OK Button
    JList 3 vertically stacked JList 3 vertical stacked JList Cancel Button
    checkboxes radio buttons
    Help Button
    Text Field Small Combo Box One checkbox
    I am having problems with mixing and matching different layouts, can you do that???? or can I use a GridLayout or Border Layout to create this?????.. and Also how do you vertically stack check boxes and radio buttons????? I'm a tad confused and frustrated.... I do not want code written as I have to do that myself, just a suggestion as to what kind of Layout I should use...
    Thanks very much
    Mike

    my previous was a bit messed up:
    I guess my question is: can you mix and match different types of Layouts on the same content pane???
    Or do you use say, BorderLayout (North, SOuth East West Center, and plop your buttons, combo boxes, JLists and text fields within each region ??????... I know how FlowLayout works, but can't use it in this situation.
    Please email at [email protected] and I can send a better graphical representation of the window I am trying to create. Again I don't want code, just a suggestion as to how to layout the window.....
    Mike

  • Report Region Layout help

    i am trying to create a page with 4 regions
    i need something link below
    region 1,2 and 3 should be on top ( 1 row 3 columns)
    Region 4 should be on 2nd row ( 4 will be below)
    I have attached word doc to below link.
    [http://www.megafileupload.com/en/file/410167/Apex-Region-Layout-docx.html]
    looks like we can only say what column number but seems the layout wont work like we need
    Edited by: user13319804 on Apr 10, 2013 9:18 AM

    Hi user13319804,
    Could we get you to change your user13319804 handle to something more like a name or nickname? (I'm Howard)
    Sorry, you can't attach files to the forum -- as far as I know.
    Yes, you can order regions. I begin by supposing you've sequence numbered them 10, 20, 30 , 40. Then edit each region 2 and 3, and under Grid Layout, choose for "Start New Grid" - No and for "Start New Row" - No. At that point the GUI should update to have "Column" - Automatic" and "New Column" - Yes on the next line. Set "Column" to 2 for region 2 and to 3 for region 3. For Region 4, leave "Start New Grid" - No and for "Start New Row" - Yes. That should place region 4 under 1. Try that.
    Then you may need a refinement so that region 4 spans across the bottom of region 1,2,3 and has the desired width.
    Regards,
    Howard

  • Drawing and some layout help for a simple control: thin lines and application start

    I am trying to create a new, simple control. The control should act as a grouping marker much like that found in the Mathematica notebook interface. It is designed to sit to the right of a node and draw a simple bracket. The look of the bracket changes depending on whether the node is logically marked open or closed.
    After looking at some blogs and searching, I tried setting the snapToPixels to true in the container holding the marker control as well as the strokewidth but I am still finding that the bracket line is too thick. I am trying to draw a thin line. Also, I am unable to get the layout to work when the test application is first opened. One of the outer brackets is cut-off. I hardcoded some numbers into the skin just to get something to work.
    Is there a better way to implement this control?
    How can I get the fine line drawn as well as the layout correct at application start?
    package org.notebook;
    import javafx.beans.property.BooleanProperty;
    import javafx.beans.property.IntegerProperty;
    import javafx.beans.property.SimpleBooleanProperty;
    import javafx.beans.property.SimpleIntegerProperty;
    import javafx.scene.control.Control;
    * Provide a simple and thin bracket that changes
    * it appearance based on whether its closed or open.
    public class GroupingMarker extends Control {
      private final static String DEFAULT_STYLE_CLASS = "grouping-marker";
      private BooleanProperty open;
      private IntegerProperty depth;
      public BooleanProperty openProperty() { return open; }
      public IntegerProperty depthProperty() { return depth; }
      public GroupingMarker(boolean open) {
      this();
      setOpen(open);
      public GroupingMarker() {
      open = new SimpleBooleanProperty(true);
      depth = new SimpleIntegerProperty(0);
      getStyleClass().add(DEFAULT_STYLE_CLASS);
      // TODO: Change to use CSS directly
      setSkin(new GroupingMarkerSkin(this));
      public boolean isOpen() {
      return open.get();
      public void setOpen(boolean flag) {
      open.set(flag);
      public int getDepth() {
      return depth.get();
      public void setDepth(int depth) {
      this.depth.set(depth);
    package org.notebook;
    import javafx.scene.Group;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.FillRule;
    import javafx.scene.shape.LineTo;
    import javafx.scene.shape.MoveTo;
    import javafx.scene.shape.Path;
    import com.sun.javafx.scene.control.skin.SkinBase;
    * The skin draws some simple lines on the right hand side of
    * the control. The lines reflect whether the control is considered
    * open or closed. Since there is no content, there is no
    * content handling code needed.
    public class GroupingMarkerSkin extends SkinBase<GroupingMarker, GroupingMarkerBehavior> {
      GroupingMarker control;
      Color lineColor;
      double shelfLength;
      double thickness;
      private Group lines;
      public GroupingMarkerSkin(GroupingMarker control) {
      super(control, new GroupingMarkerBehavior(control));
      this.control = control;
      lineColor = Color.BLUE;
      shelfLength = 5.0;
      thickness = 1.0;
      init();
      * Attached listeners to the properties in the control.
      protected void init() {
      registerChangeListener(control.openProperty(), "OPEN");
      registerChangeListener(control.depthProperty(), "DEPTH");
      lines = new Group();
      repaint();
      @Override
      protected void handleControlPropertyChanged(String arg0) {
      super.handleControlPropertyChanged(arg0);
        @Override public final GroupingMarker getSkinnable() {
            return control;
        @Override public final void dispose() {
        super.dispose();
            control = null;
        @Override
        protected double computePrefHeight(double arg0) {
        System.out.println("ph: " + arg0);
        return super.computePrefHeight(arg0);
        @Override
        protected double computePrefWidth(double arg0) {
        System.out.println("pw: " + arg0);
        return super.computePrefWidth(40.0);
         * Call this if a property changes that affects the visible
         * control.
        public void repaint() {
        requestLayout();
        @Override
        protected void layoutChildren() {
        if(control.getScene() != null) {
        drawLines();
        getChildren().setAll(lines);
        super.layoutChildren();
        protected void drawLines() {
        lines.getChildren().clear();
        System.out.println("bounds local: " + control.getBoundsInLocal());
        System.out.println("bounds parent: " + control.getBoundsInParent());
        System.out.println("bounds layout: " + control.getLayoutBounds());
        System.out.println("pref wxh: " + control.getPrefWidth() + "x" + control.getPrefHeight());
        double width = Math.max(0, 20.0 - 2 * 2.0);
        double height = control.getPrefHeight() - 4.0;
        height = Math.max(0, control.getBoundsInLocal().getHeight()-4.0);
        System.out.println("w: " + width + ", h: " + height);
        double margin = 4.0;
        final Path VERTICAL = new Path();
        VERTICAL.setFillRule(FillRule.EVEN_ODD);
        VERTICAL.getElements().add(new MoveTo(margin, margin)); // start
        VERTICAL.getElements().add(new LineTo(margin + shelfLength, margin)); // top horz line
        VERTICAL.getElements().add(new LineTo(margin + shelfLength, height - margin)); // vert line
        if(control.isOpen()) {
        VERTICAL.getElements().add(new LineTo(margin, height - margin)); // bottom horz line
        } else {
        VERTICAL.getElements().add(new LineTo(margin, height-margin-4.0));
        //VERTICAL.getElements().add(new ClosePath());
        VERTICAL.setStrokeWidth(thickness);
        VERTICAL.setStroke(lineColor);
        lines.getChildren().addAll(VERTICAL);
        lines.setCache(true);
    package org.notebook;
    import com.sun.javafx.scene.control.behavior.BehaviorBase;
    public class GroupingMarkerBehavior extends BehaviorBase<GroupingMarker> {
      public GroupingMarkerBehavior(final GroupingMarker control) {
      super(control);
    package org.notebook;
    import javafx.application.Application;
    import javafx.scene.Node;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.control.TextArea;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class TestGroupingMarker extends Application {
      public static void main(String args[]) {
      launch(TestGroupingMarker.class, args);
      @Override
      public void start(Stage stage) throws Exception {
      VBox vbox = new VBox();
      BorderPane p = new BorderPane();
      VBox first = new VBox();
      first.getChildren().add(makeEntry("In[1]=", "my label", 200.0, true));
      first.getChildren().add(makeEntry("Out[1]=", "the output!", 200.0, true));
      p.setCenter(first);
      p.setRight(new GroupingMarker(true));
      vbox.getChildren().add(p);
      vbox.getChildren().add(makeEntry("In[2]=", "my label 2", 100.0, false));
      Scene scene = new Scene(vbox,500,700);
      scene.getStylesheets().add(TestGroupingMarker.class.getResource("main.css").toExternalForm());
      stage.setScene(scene);
      stage.setTitle("GroupingMarker test");
      stage.show();
      protected Node makeEntry(String io, String text, double height, boolean open) {
      BorderPane pane2 = new BorderPane();
      pane2.setSnapToPixel(true);
      Label label2 = new Label(io);
      label2.getStyleClass().add("io-label");
      pane2.setLeft(label2);
      TextArea area2 = new TextArea(text);
      area2.getStyleClass().add("io-content");
      area2.setPrefHeight(height);
      pane2.setCenter(area2);
      GroupingMarker marker2 = new GroupingMarker();
      marker2.setOpen(open);
      pane2.setRight(marker2);
      return pane2;

    The test interfaces are already defined for you - the 3rd party session bean remote/local interfaces.
    It is pretty trivial to create implementations of those interfaces to return the test data from your XML files.
    There are a number of ways to handle the switching, if you have used the service locator pattern, then I would personally slot the logic in to the service locator, to either look up the 3rd party bean or return a POJO test implementation of the interface according to configuration.
    Without the service locator, you are forced to do a little more work, you will have to implement your own test session beans to the same interfaces as the 3rd party session beans.
    You can then either deploy them instead of the 3rd party beans or you can deploy both the test and the 3rd party beans under different JNDI names,and use ejb-ref tags and allow you to switch between test and real versions by changing the ejb-link value.
    Hope this helps.
    Bob B.

  • Newbie Layout Help Needed

    I am normally an After Effects and Premiere Pro user but have been forced to volunteer for help on a Dreamweaver project. 
    The site is built on the template: HTML, 1 column fixed, centered, header and footer.  I want to be able to insert a photo the width of the main column, 960 px I think.  Then, under that photo, I want to insert 4 photos with different widths, between 150 and 200 pixels wide.  I will need to update this from time to time and the quantity and sizes of the photos will be different each time.  If "Draw AP Div" worked like I expected it to, it would be simple: draw boxes and insert images.  However, as you know, it's not going to be that easy.  I have read the formatting101 page and searched the forum but I guess I don't know enough to know what to search for.
    Is there a way to place images in the way I want to?  Do I need a plug-in?   I need to where to start. 

    You don't need APDivs for this.  If you want the secondary images to be evenly spaced on the page, use CSS floats & margins.
    http://alt-web.com/DEMOS/3-CSS-boxes.shtml
    If you don't need them evenly spaced, simply insert optimized images into your layout.  Be sure to resize images beforehand in your graphics editor so that their combined widths will fit inside the layout.
    <p style="text-align"center">
    <img src="top-image.jpg" width="xx" height="xx" alt="description">
    </p>
    <p style="text-align:center">
    <img src="image1.jpg" width="xx" height="xx" alt="description">  
    <img src="image2.jpg" width="xx" height="xx" alt="description">  
    <img src="image3.jpg" width="xx" height="xx" alt="description">  
    <img src="image4.jpg" width="xx" height="xx" alt="description">
    </p>
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/

  • Creating GUI based Help File!!!

    Can anyone point me to a resource where I can find information for creating Help for a GUI based application? I know that javadoc can create API specification for standalone programs but I like something for GUI based application like the one found on MS Word under Help menu.
    Need help plz.
    --DM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    If anyone is trying to find out how DM777 implemented help. I would guess that he found JavaHelp.
    Here's a search to get you started
    http://onesearch.sun.com/search/developers/index.jsp?and=javahelp&nh=10&phr=&qt=&not=&field=&since=&col=javadoc&col=javatecharticles&col=javatutorials&col=devarchive&col=devall&rf=0&Search.x=0&Search.y=0

  • GridBag or Flow Layout: Help Please!!!

    Requirement: Allow the user to input the amount of a mortgage and then select from a menu of mortgage loans: 7 years at 5.35%, 15 years at 5.5%, and 30 years at 5.75%. Use an array for the different loans. Display the mortgage payment amount. Then, list the loan balance and interest paid for each payment over the term of the loan. Allow the user to loopback and enter a new amount and make a new selection or quit.
    I have written the code so far that allows for the creation of the pane, texts, user entry, combobox, and buttons.
    My problem is that I cannot get it sorted out to look like a usable interface. I don't know if I should go with a GridBag Layout or a Flow Layout.
    I am using the GridBag Layout in this example, but obviously I am missing the correct procedure on how to do it.
    Can anyone give me a hand?
    My goal for the interface is to have the following fields set up in the pane to lay out like this:
    Mortgage ------ MortgageTF
    Loan ----- LoanCB
    Payment ----- PaymentTF
    Balance
    Compute----- Reset----- Exit
    Thank you for any assistance.
    Havok
    My written code is below:
    import javax.swing.*;
    import java.awt.*;
    public class MCalc002 extends JFrame
    public MCalc002()
    super("Mortgage Calculator");
    setSize(500, 800);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setVisible(true);
    Container pane = getContentPane();
    GridBagLayout gridBag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();
    pane.setLayout(gridBag);
    JLabel mortgage = new JLabel("Mortgage:");
    c.gridx = 0; c.gridy = 0;
    pane.add(mortgage);
    JLabel loan = new JLabel("Loan Menu:");
    c.gridx = 2; c.gridy = 2;
    pane.add(loan);
    JLabel payment = new JLabel("Monthly Payment:");
    c.gridx = 3; c.gridy = 3;
    pane.add(payment);
    JLabel balance = new JLabel("Loan Balance:");
    c.gridx = 4; c.gridy = 4;
    pane.add(balance);
    JTextField mortgageTF = new JTextField(10);
    c.gridx = 4; c.gridy = 4;
    pane.add(mortgageTF);
    JComboBox loanCB = new JComboBox();
    c.gridx = 5; c.gridy = 5;
    loanCB.addItem("Please Select");
    loanCB.addItem("7yrs @ 5.35%");
    loanCB.addItem("15yrs @ 5.5%");
    loanCB.addItem("30yrs @ 5.75%");
    pane.add(loanCB);
    JTextField paymentTF= new JTextField(10);
    c.gridx = 4; c.gridy = 4;
    pane.add(paymentTF);
    JButton compute = new JButton("Compute");
    c.gridx = 5; c.gridy = 5;
    pane.add(compute, c);
    JButton reset = new JButton("Reset");
    c.gridx = 6; c.gridy = 6;
    pane.add(reset, c);
    JButton exit = new JButton("Exit");
    c.gridx = 7; c.gridy = 7;
    pane.add(exit, c);
    setContentPane(pane);
    public static void main(String[] arguments)
    MCalc002 pb = new MCalc002();
    //EOF

    My problem is that I cannot get it sorted out to look
    like a usable interface. I don't know if I should go
    with a GridBag Layout or a Flow Layout.
    My goal for the interface is to have the following
    fields set up in the pane to lay out like this:
    Mortgage ------ MortgageTF
    Loan ----- LoanCB
    Payment ----- PaymentTF
    Balance
    Compute----- Reset----- Exit
    import javax.swing.*;
    import java.awt.*;
    public class MCalc002 extends JFrame {
        public MCalc002() {
            super("Mortgage Calculator");
            setSize(500, 800);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            Container pane = getContentPane();
            GridBagLayout gridBag = new GridBagLayout();
            GridBagConstraints c = new GridBagConstraints();
            pane.setLayout(gridBag);
            JLabel mortgage = new JLabel("Mortgage:");
            c.gridx = 0; c.gridy = 0;
            c.insets = new Insets(20,10,20,10);
            gridBag.setConstraints(mortgage, c);
            pane.add(mortgage);
            JLabel loan = new JLabel("Loan Menu:");
            c.gridx = 0; c.gridy = 1;
            c.insets = new Insets(20,10,20,10);
            gridBag.setConstraints(loan, c);
            pane.add(loan);
            JLabel payment = new JLabel("Monthly Payment:");
            c.gridx = 0; c.gridy = 2;
            c.insets = new Insets(20,10,20,10);
            gridBag.setConstraints(payment, c);
            pane.add(payment);
            JLabel balance = new JLabel("Loan Balance:");
            c.gridx = 0; c.gridy = 3;
            c.insets = new Insets(20,10,20,10);
            gridBag.setConstraints(balance, c);
            pane.add(balance);
            JTextField mortgageTF = new JTextField(10);
            c.gridx = 3; c.gridy = 0;
            c.insets = new Insets(20,10,20,10);
            gridBag.setConstraints(mortgageTF, c);
            pane.add(mortgageTF);
            JComboBox loanCB = new JComboBox();
            c.gridx = 3; c.gridy = 1;
            c.insets = new Insets(20,10,20,10);
            loanCB.addItem("Please Select");
            loanCB.addItem("7yrs @ 5.35%");
            loanCB.addItem("15yrs @ 5.5%");
            loanCB.addItem("30yrs @ 5.75%");
            gridBag.setConstraints(loanCB, c);
            pane.add(loanCB);
            JTextField paymentTF= new JTextField(10);
            c.gridx = 3; c.gridy = 2;
            c.insets = new Insets(20,10,20,10);
            gridBag.setConstraints(paymentTF, c);
            pane.add(paymentTF);
            JButton compute = new JButton("Compute");
            c.gridx = 0; c.gridy = 4;
            c.insets = new Insets(20,10,20,10);
            gridBag.setConstraints(compute, c);
            pane.add(compute, c);
            JButton reset = new JButton("Reset");
            c.gridx = 1; c.gridy = 4;
            c.insets = new Insets(20,10,20,10);
            gridBag.setConstraints(reset, c);
            pane.add(reset, c);
            JButton exit = new JButton("Exit");
            c.gridx = 3; c.gridy = 4;
            c.insets = new Insets(20,10,20,10);
            gridBag.setConstraints(exit, c);
            pane.add(exit, c);
            setContentPane(pane);
            setVisible(true);  // Generally speaking, this should be the last operation in setting up GUI components.
        public static void main(String[] arguments) {
            MCalc002 pb = new MCalc002();
    }

  • Report Layout Help

    Version 2.0
    I have a report that I'm having difficulities in getting a layout for. This report is a sales analysis that can be fiscal or calendar year. The look I'm after is:
    Account  Nov-05    Dec-05    Jan-06    Feb-06    Mar-06    Apr-06    May-06    Jun-06    Jul-06    Aug-06    2006 Total    2005 Total    Difference    Percent Inc/Dec
    Acct1    $9999.99  $9999.99  $9999.99  $9999.99  $9999.99  $9999.99  $9999.99  $9999.99  $9999.99  $9999.99  $99999.99     $99999.99     $9999.99      99.9Any help is greatly appreciated.
    Thanks,
    Joe

    John,
    1. Well, he is an extreme "joy" to work with. I'll admit that. Been in the managers office a few times.
    2. In the mark up that I provided above, August was the month that was selected from the "Select Month" drop down list. Since the "Calendar" checkbox was not selected, that meant that they wanted the beginning of the current fiscal year, Nov-05, to the selected month, in that example, Aug-06.
    I am taking care of the beginning and ending dates through date math. If you like I can provide that code too.
    I hope that was clear.
    Thanks,
    Joe

  • Simple css layout help

    Hey I know this is a piece of cake for you guys so help me
    out. I've got a simple layout going and set up at
    http://www.clark-imaging.com/ciiicomp/index.html
    and need your help. What is causing the weird white bands behind
    header and maincontent and footer and maincontent? There are no
    margin values assigned to the top and bottom of the header and
    footer, and a value of 0 won't make them go away. Also, how can I
    fix the footer div to the bottom of the window, so the main content
    area stretches with the window?
    Here's an
    image of the look I'm going for.
    Your responses are greatly appreciated.

    This will do what you want. View source code to see how it's
    built.
    http://alt-web.com/CSS2-1-column-fixed-width-centered.html
    Nancy O.
    Alt-Web Design & Publishing
    www.alt-web.com

  • Test GUI Exception----help!!!!!!!!!!!!!!!!

    I run the junit test case from dos after typing
    "java junit.swingui.TestRunner MoneyTest"
    Before running the test case in the junit sample fold, i set the Classpath which include one fold named "test", then i copy the sample of MoneyTest into this fold to try Junit, but the result is :
    GUI appears and i also can use the Test Selector search all the Test Cases from the fold "test" ,but in Dos window shows following Exception: (GUI of course can not run)
    Exception in thread "main" java.lang.NoClassDefFoundError: MoneyTest (wrong name
    : junit/samples/money/MoneyTest)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at junit.runner.TestCaseClassLoader.loadClass(TestCaseClassLoader.java:1
    04)
    at junit.runner.ReloadingTestSuiteLoader.load(ReloadingTestSuiteLoader.j
    ava:9)
    at junit.runner.BaseTestRunner.loadSuiteClass(BaseTestRunner.java:193)
    at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:86)
    at junit.swingui.TestRunner.runSuite(TestRunner.java:591)
    at junit.swingui.TestRunner.start(TestRunner.java:708)
    at junit.swingui.TestRunner.main(TestRunner.java:52)
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: MoneyTest
    (wrong name: junit/samples/money/MoneyTest)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at junit.runner.TestCaseClassLoader.loadClass(TestCaseClassLoader.java:1
    04)
    at junit.runner.ReloadingTestSuiteLoader.load(ReloadingTestSuiteLoader.j
    ava:9)
    at junit.runner.BaseTestRunner.loadSuiteClass(BaseTestRunner.java:193)
    at junit.runner.BaseTestRunner.getTest(BaseTestRunner.java:86)
    at junit.swingui.TestRunner.runSuite(TestRunner.java:591)
    at junit.swingui.TestRunner$9.actionPerformed(TestRunner.java:283)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
    ce)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    I dont know where problems happened??? Thank you for any help!!!!
    Alonso

    I run the junit test case from dos after typing
    "java junit.swingui.TestRunner MoneyTest"
    Exception in thread "main"
    java.lang.NoClassDefFoundError: MoneyTest (wrong
    name
    : junit/samples/money/MoneyTest)
    I dont know where problems happened??? Thank you for
    any help!!!!See the part in the exception about where is says "wrong name"?
    It means you used the wrong name (surprising how that works.)
    See the section after it where is says "junit/samples/money/MoneyTest"?
    That tells you that it couldn't find the name that you gave it, but that it did find a name called junit.samples.money.MoneyTest.
    It is up to you to figure out if you really wanted to use junit.samples.money.MoneyTest or if you made a mistake in something else.

  • Flow layout help please

    I am trying to position 3 buttons with 3 text fields underneath. I am using flowlayout but it puts it all on one line. I have tried grid layout too but this doesn't help.
    Is there anything I can do to split the buttons and text fields onto 2 separate lines?
    thanks

    I have tried grid layout too but this
    doesn't help.Yeah? hmm... it should work:
    setLayout(new GridLayout(2,3));
    getContentPane.add(button1);
    getContentPane.add(button2);
    getContentPane.add(button3);
    getContentPane.add(text1);
    getContentPane.add(text2);
    getContentPane.add(text3);

  • Newbie: Java FX Resizable Gui Layout

    Dear all,
    I am trying to create a User Interface for entering address data. The GUI should be resizable so i was experimenting with the jfxtras Grid Layout.
    With the included code a rudimentary Gui is created. My Problem is that i cannot control the initial sizes of my TextBoxes. In my example the Kunden Nr is too large. The Name and Vorname Fields are too small. I tried to manage the sizes using the hspan variable. Defining widths using layoutInfo was not successful.
    Can anyone give me a hint how to set sizes for TextBoxes ?
    Thanks in advance
    import org.jfxtras.scene.layout.*;
    import org.jfxtras.scene.*;
    import javafx.scene.*;
    import javafx.stage.*;
    import ch.bizWare.fx.components.*;
    import javafx.scene.control.TextBox;
    import javafx.scene.text.*;
    import javafx.scene.layout.*;
    import org.jfxtras.scene.shape.*;
    import javafx.scene.paint.*;
    // Container Definition
    var scene : ResizableScene;
    var mainStage : Stage;
    var tbKdNr : TextBox = TextBox{
        layoutInfo: GridLayoutInfo{hgrow: Grow.ALWAYS}
    var lKdNr : Text = Text{
        content: "Kunden Nr"
    var tbAnrede : TextBox = TextBox{
        layoutInfo: GridLayoutInfo{hgrow: Grow.ALWAYS, hspan: 1}
    var lAnrede : Text = Text{
        content: "Anrede"
    var tbName : TextBox = TextBox{
        layoutInfo: GridLayoutInfo{hgrow: Grow.ALWAYS, hspan : 2}
    var lName : Text = Text{
        content: "Name"
    var tbVorname : TextBox = TextBox{
        layoutInfo: GridLayoutInfo{hgrow: Grow.ALWAYS, hspan: 2}
    var lVorname : Text = Text{
        content: "Vorname"
    var tbAdresse : TextBox = TextBox{
        layoutInfo: GridLayoutInfo{hgrow: Grow.ALWAYS, hspan: 4}
    var lAdresse : Text = Text{
        content: "Adresse des Kunden"
    var tbPlzOrt : TextBox = TextBox{
        layoutInfo: GridLayoutInfo{hgrow: Grow.ALWAYS, hspan: 2}
    var lPlzOrt : Text = Text{
        content: "PLZ/Ort"
    var grid : Grid = Grid {
        rows: [ Row{
                     cells : [lKdNr, tbKdNr]
                Row{
                    cells : [lAnrede, tbAnrede, lName, tbName, lVorname, tbVorname]
                Row{
                    cells : [lAdresse, tbAdresse, lPlzOrt, tbPlzOrt]
    scene = ResizableScene {
       width : 600;
       height: 200;
       content:grid    
    // Stage Initialize
    mainStage = Stage {
        title : "Adresse erfassen"
        scene : scene
    }

    Here is my resizable custom EmployeeUI component with address
    package ui.custom;
    import javafx.scene.shape.Rectangle;
    import javafx.stage.Stage;
    import javafx.scene.paint.Color;
    import org.jfxtras.scene.ResizableScene;
    import javafx.scene.text.Text;
    import org.jfxtras.scene.layout.MigLayout;
    import org.jfxtras.scene.layout.MigLayout.*;
    import loans.calc.*;
    import javafx.stage.Stage;
    import javafx.scene.Node;
    import javafx.scene.paint.Color;
    import javafx.scene.control.TextBox;
    import javafx.scene.control.Button;
    import javafx.scene.CustomNode;
    import javafx.scene.Scene;
    import javafx.scene.control.Label;
    import javafx.scene.layout.Stack;
    import org.jfxtras.scene.ResizableCustomNode;
    import org.jfxtras.scene.layout.ResizableVBox;
    import org.jfxtras.stage.JFXDialog;
    import javafx.ext.swing.SwingComboBox;
    import javafx.ext.swing.SwingComboBoxItem;
    import javafx.util.Sequences;
    import javafx.scene.paint.LinearGradient;
    import javafx.scene.paint.Stop;
    import javafx.scene.text.Font;
    import javafx.ext.swing.SwingComponent;
    import javax.swing.JTextArea;
    import javax.swing.JScrollPane;
    import javafx.ext.swing.SwingTextField;
    import javafx.scene.shape.Line;
    * @author gusaros
    public class EmployeeUI extends ResizableCustomNode {
    var linearGradient = LinearGradient {
                endY: 1 endX: 0
                stops : [
                    Stop { offset: 0.0 color: Color.web("#eae8e3") },
                    Stop { offset: 1.0 color: Color.WHITE },
    public  var employee:Employee;
    var line1 = Line {
              startX: 10, startY: 10
              endY: 10
              endX: bind width - 10
              // endX: 230, endY: 100
              strokeWidth: 2
              stroke: Color.DARKGRAY
    var header = Text {content:
               "E m p l o y e e   i n f o r m a t i o n"
               font: Font.font("Serif",18)
         var emptyLabel=Label {
             id:"emptyLabel"
             text: ""};
      var firstNameLabel=Label {
             id:"firstNameLabel"
             text: "First Name:"};
    var firstNameField=TextBox {
           id:"firstNameField"
           selectOnFocus: false
           editable:false
           text: bind employee.firstName
       var lastNameLabel=Label {
           id:"lastNameLabel"
            text: "Last Name:" };
        var lastNameField=TextBox {
        id:"lastNameField"
        text: bind employee.lastName
    var dobLabel=Label {
           id:"dobLabel"
            text: "DOB:" };
    var dobField=TextBox {
        id:"dobField" };
    var taxNumberLabel=Label {
           id:"taxNumberLabel"
            text: "Tax number:" };
    var taxNumberField=TextBox {
        id:"taxNumberField" };
    var titleLabel=Label {
           id:"titleLabel"
            text: "Title:" };
    var titleField=TextBox {
        id:"titleField" };
    var planTypeLabel=Label {
           id:"planTypeLabel"
            text: "Plan type:" };
    var planTypeField=TextBox {
        id:"planTypeField" };
    var activeStatusLabel=Label {
           id:"activeStatusLabel"
            text: "Active status:" };
    var activeStatusField=TextBox {
        id:"activeStatusField"
      var serviceLabel=Label {
           id:"servicel"
            text: "Service:" };
    var serviceField=TextBox {
        id:"servicef"  };
    var deductionsLabel=Label {
           id:"deductionsLabel"
            text: "Deductions:" };
    var deductionsField=TextBox {
        id:"deductionsField"
        text:"0"
    var deductionsLabel75=Label {
           id:"deductionsLabel75"
            text: bind if (activeStatusField.text == "B")   " 75% deductions:"  else
            " 90% deductions:"         };
    var deductionsField75=TextBox {
        id:"deductionsField75"
        text: bind if (activeStatusField.text == "B") "{Double.parseDouble(deductionsField.text) * 0.75 }"
                  else  "{Double.parseDouble(deductionsField.text) * 0.9 }"
    var minPaymentLabel=Label {
           id:"minpaymentLabel"
            text: "Minimum payment:" };
    var minPaymentField=TextBox {
           id:"minpaymentfield"
    var reserveLabel=Label {
           id:"reserveLabel"
            text: "Reserve:" };
    var reserveField=TextBox {
        id:"reserveField"
        text:""
    var taxableamtLabel=Label {
           id:"taxableamtLabel"
            text: "Taxable amt:" };
    var taxableamtField=TextBox {
        id:"taxableamtField"
        text:""
    var dcploanLabel=Label {
           id:"ldcploanLabel"
            text: "Current DCP loan :" };
    var dcploanField=TextBox {
        id:"dcploanField"
        text:""
    var addressLabel=Label {
        id:"addressLabel"
        text: "Address:"
    var addressField=TextBox {
        id:"addressField"
    var cityLabel=Label {
        id:"cityLabel"
        text: "City:"
    var cityField=TextBox {
        id:"cityField"
    var stateLabel=Label {
        id:"stateLabel"
        text: "State:"
    var stateField = TextBox {
        id: "statefield"
        columns: 2
    var stateField:SwingComboBox = SwingComboBox {
       id: "stateField"
       items: [
          SwingComboBoxItem{text:"MD"},
          SwingComboBoxItem{text:"CA"},
          SwingComboBoxItem{text:"NY"}
       visible: true
    var zipLabel=Label {
       id:"zipCodeLabel"
       text: "ZIP Code:"
    var zipField=TextBox {
       id:"zipCodeField"
      // Nodes to be laid out
    var nodesToLayout = bind [
        migNode(header, "span,alignx center, wrap" ),
          migNode(emptyLabel,   "wrap" ),
       migNode(firstNameLabel,  "" ),
       migNode(firstNameField,  "" ),
       migNode(lastNameLabel,  "alignx right" ),
       migNode(lastNameField, "" ),
       migNode(dobLabel, "alignx right" ),
       migNode(dobField, "wrap" ),
       migNode(taxNumberLabel, "" ),
       migNode(taxNumberField, "" ),
        migNode(titleLabel, "alignx right" ),
       migNode(titleField, "span, grow,wrap" ),
       migNode(planTypeLabel, "" ),
       migNode(planTypeField, "" ),
       migNode(activeStatusLabel, "alignx right" ),
       migNode(activeStatusField, "" ),
       migNode(serviceLabel, "alignx right" ),
       migNode(serviceField, "wrap" ),
    migNode(Label{ text:"" }, "wrap" ),
    // migNode( line1, "span"  ),
    // migNode(Label{ text:"" }, "wrap" ),
    migNode(addressLabel, "" ),
      migNode(addressField,  "span, grow" ),
       migNode(cityLabel, "" ),
       migNode(cityField, "" ),
       migNode(stateLabel, "alignx right" ),
       migNode(stateField, "", ),
       migNode(zipLabel, "alignx right" ),
       migNode(zipField, "wrap" ),
       migNode(Label{ text:"" }, "wrap" ),
       // ... other nodes are added here ...
      var rowConstraintString:String = "";
    var layoutConstraintString:String = "";
    override function create() {
                MigLayout {
                   constraints: bind layoutConstraintString
                   content:bind  nodesToLayout
                   rows: bind rowConstraintString
    }

  • Box layout help

    i know how to use a box layout on panels but i am having a problem applying box layout on jframe,
    what i do basicaly is extends jframe first and then in the constructor i put setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
    it gives an error that box layout cant be shared...this method works with all other layouts...
    please help me and please dont tell me to go read the sun online tutorials...

    To speak truely. All the j2se default layout manager will be replaced by the default layoutmanager in NetBeans ---group layout manager.
    I suggest you download a NetBeans IDE and start working with the new layout manager.

  • Scrolling, and Adaptive Layout help

    Hi guys, I am new to edge animate,
    I would like to know, like when a person scrolls its scrolls to a cirtain point seemlessly, not like when you are using a mouse, like blobk by block.
    also I would like to know more about adaptive layout, if anyone can help me more thorught skype,
    I would me really pleased, thank you
    my skype is Kevin2019170
    Thank you

    Well, only can help you with the background image...  put this code on document.compositionReady and window.resize events:
    var imageRatio = 1.7777; // Aspect 16:9, you can use any proportion depends of your image dimensions
    var sWidth = $(window).width()
    var sHeight = $(window).height()
    if ((sWidth / sHeight) > imageRatio) {
      sym.$("imgBackground").css("width", sWidth +"px");
      sym.$("imgBackground").css("height", sWidth/imageRatio +"px");
    else {
      sym.$("imgBackground").css("width", sHeight*imageRatio +"px");
      sym.$("imgBackground").css("height", sHeight +"px");

Maybe you are looking for

  • How can I display a PDF in Fit-Page View mode in Firefox?

    I would like to use Firefox to view PDF documents from the web - but cannot get the PDF fit-page view to be a Firefox option. For large PDF files, I then have to scroll slowly through them - whereas in Adobe Reader, I can view them page by page and s

  • Unable to launch PS Elements 11 on Windows 7

    I was able to successfully download and install the trial version of PS Elements 11 on 64 bit Windows 7.  However, trying to open the program doesn't result in any error, it just won't launch.  Even after rebooting I am not able to launch the program

  • My BlackBerry 9800 cant play video's on youtube

    Hello please help me, when i play vedio it say buffing then after sometime it gives me this message 'Content not available. Server is blocked or unresponsive' whats the problem?

  • Netgear WPN824v2 MIMO Router Help

    Hi. I am not recieving good signal around my house. What is happening? Wasn't this router suppose tu boost up the performance? I am not using my iBook right now... I am using a Toshiba Satellite notebook with 54g Intel Pro connection. Is this the pro

  • Publishing via OSX Server 104

    I am trying to set up a client s OS X Server web server to accept their iCal calendars. I have gone through the Apple instructions - create a realm, create a folder, user lists, turn on WebDAV, restart the web server. However, I keep getting an error