POLALA.COM
welcome to my space
X
Search:  
Welcome to:polala.com
NAVIGATION: Home >>

Java Swing Interface Quirk

Published by: jane 2009-01-07

  • kellegous: Save Your Design::
    We had designed the interface to have an area for local copies on the left and a (with the OSX implementation being the undisputed king of quirk).
    http://web.kellegous.com/ecrits/855
    HOME
    Ok, so I'm writing a program with a GUI for the first time.. but I'm kind of a perfectionist so this is bugging me:

    Frame root = new JFrame();

    JPanel input_screen;
    JPanel wait_screen;
    JPanel result_screen;

    JTextArea input;
    JTextArea solution_box;
    Calling Java from Mathematica - Wolfram Mathematica::
    A quirk of ShareKernel is that you cannot call ShareKernel and The implementation uses the Swing user interface classes, because Swing has a built- in
    http://reference.wolfram.com/mathematica/JLink/tutorial/CallingJavaFromMathematica.html
    HOME
    JScrollPane scroll;

    ...

    input_screen = new JPanel();

    // Create the screen where they enter the puzzle
    Box box = Box.createVerticalBox();

    JLabel puzzleText = new JLabel("Puzzle:");
    box.add(puzzleText);

    input = new JTextArea(5, 5);
    box.add(input);

    JButton solve = new JButton("Solve");
    AWT@Everything2.com::
    File Format: WAP WML - View as HTMLa new class library that implements user interface elements directly in Java. Swing provides a rich set of UI elements, and where bugs exist, at least they
    http://babelserver.org/babel?url=everything2.com/title/AWT
    HOME
    solve.setActionCommand("submit");
    box.add(solve);

    solve.addActionListener(this);

    input_screen.add(box);


    The problem is that when I type in the JTextArea, the JLabel and JButton above and below it move with the text. How can I set them to be in fixed positions? I tried containing the JTextArea in its own JPanel.. but it didn't fix it.


  • You can also specifiy exact positioning just incase you or anyone else is interested.


    setLayout(null);

    objectName.setBounds(left, top, width, height);

    The layout managers are more ideal, but for small GUI applets I sometimes use exact positioning.


  • You need to use a layout manager to handle positioning of all of your controls. My favorite is GridLayout, and you can find out more about it here: http://java.sun.com/docs/books/tutorial/uiswing/layout/grid.html (this link also contains info on other layout managers on the left nav)

    :)


  • Thanks Kirupa, just what I was looking for :)

    BorderLayout ended up working best in this instance :D





  • Where's The Advantage In Windows Genuine Advantage?
    Stocks Bounce After S&P Joins Bear Market

    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Java Swing Interface Quirk , Please add it free.

    Suggested articles

  • i am trying to find a web site that shows you how to build a solar panel from collection to storage
  • whats a nice oil to burn in our house
  • skinny in 4 months time
  • what do you think the stakes are for using the internet
  • is it true that a kitchen sponge may be sterilized by moistening it and heating in the microwave
  • why is aggregate so important in construction
  • how to eject a cd on a macbook
  • whats a good gamers laptop
  • acer aspire one or a hp mini note
  • what is the difference between finding and stealing is it ok to find something and keep it
  • a question on decorating my room
  • i bought a notebook in france it came with windows xp in french language how to change language to english
  • what is positive shut off in valves
  • how can i prevent ants from entering into my apartment in a budget way

  • About us |Contact us |Advertisement |Site map |Exchange links
    Copyright© 2008polala.com All Rights Reserved