JFrame Display

Hi all,
i need an help over JFrame ....
Say i have two Classes (JFrame Window) called clsOne and clsTwo..
when i run clsOne it opens and it has tow Button open and exit...
if i press open Button it has to open the Second class clsTwo(second frame widow) and the previous window has to clear(it should display).
iam using System.exit(0);
it clearing(exits)both windows(frame).i want the second window to be displayed and the first window should not display anymore.
can any one help me solve this problem

i think what your trying to do is to open the second frame and hide the first so in that case its quite simple.
Firstly dont use System.exit(0) as it terminate everything.
You need to call the 'show()' method on your second frame and 'hide()' on your first frame
i.e.
public class MyFrame extends JFrame {
// Create the object
MySecondFrame secondFrame = new MySecondFrame();
// Show the frame
secondFrame.show();
// hide the current frame
this.hide();

Similar Messages

  • JFrame display problem

    Hi All,
    My JFrame has 3 big tables and few label and text fields. It clips some rows in table while displaying and if I use maximun resulution then it displays properly.
    Is it because of the layout I am using or because og the big size of the table?
    Is there way to shrink the table size?
    Folowing is code ( sorry for such a huge file )
    import javax.swing.border.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    import javax.swing.*;
    public class Graph_Page_I extends javax.swing.JFrame {
    // Variables declaration - do not modify
    private JPanel jPanel1,jPanel1a,jPanel1b,jPanel1c,jPanel1d,jPanel2,jPanel2a,jPanel2b,jPanel2aa,jPanel2ab,jPanel2ba,jPanel2bb,jPanel3,jPanel3a,jPanel3b,jPanel12;
    private JLabel jLabel1,jLabel2,jLabel3,jLabel4,jLabel5,jLabel6,jLabel7,jLabel8,jLabel9,jLabel10;
    private JTextField jTextField1,jTextField2,jTextField3,jTextField4;
    private JTable jTable1,jTable2,jTable3;
    // End of variables declaration
    /** Creates new form Graph_Page_I */
    public Graph_Page_I() {
    initComponents();
    private void initComponents() {
    jPanel1 = new JPanel();
    jPanel1a = new JPanel();
    jLabel1 = new JLabel();
    jLabel2 = new JLabel();
    jTextField1 = new JTextField(7);
    jPanel1b = new JPanel();
    jLabel3 = new JLabel();
    jTextField2 = new JTextField(7);
    jPanel1c = new JPanel();
    jLabel4 = new JLabel();
    jTextField3 = new JTextField(7);
    jLabel5 = new JLabel();
    jPanel1d = new JPanel();
    jLabel6 = new JLabel();
    jTextField4 = new JTextField(7);
    jLabel7 = new JLabel();
    jPanel3 = new JPanel();
    jPanel3a = new JPanel();
    jLabel10 = new JLabel();
    jPanel3b = new JPanel();
    jTable1 = new JTable();
    jTable2 = new JTable();
    jTable3 = new JTable();
    jPanel12 = new JPanel();
    jPanel2 = new JPanel();
    jPanel2a = new JPanel();
    jPanel2aa = new JPanel();
    jLabel8 = new JLabel();
    jPanel2ab = new JPanel();
    jPanel2b = new JPanel();
    jPanel2ba = new JPanel();
    jLabel9 = new JLabel();
    jPanel2bb = new JPanel();
    setTitle("GraphPage I");
    setBackground(java.awt.Color.white);
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent evt) {
    exitForm(evt);
    jPanel1a.setLayout(new java.awt.FlowLayout(FlowLayout.LEFT));
    jPanel1b.setLayout(new java.awt.FlowLayout(FlowLayout.LEFT));
    jPanel1c.setLayout(new java.awt.FlowLayout(FlowLayout.LEFT));
    jPanel1d.setLayout(new java.awt.FlowLayout(FlowLayout.LEFT));
    jPanel2aa.setLayout(new java.awt.FlowLayout(FlowLayout.LEFT));
    jPanel2ba.setLayout(new java.awt.FlowLayout(FlowLayout.LEFT));
    jPanel3a.setLayout(new java.awt.GridLayout(4, 0));
    jLabel1.setText("Enter ");
    jPanel1a.add(jLabel1);
    jLabel2.setText("Name of Laboratory: ");
    jPanel1a.add(jLabel2);
    jTextField1.setText("");
    jPanel1a.add(jTextField1);
    jPanel1.setLayout(new java.awt.GridLayout(4, 0));
    jPanel1.add(jPanel1a);
    jLabel3.setText(" Date: ");
    jPanel1b.add(jLabel3);
    jTextField2.setText("");
    jPanel1b.add(jTextField2);
    jPanel1.add(jPanel1b);
    jLabel4.setText(" Run Number(1 or 2): ");
    jPanel1c.add(jLabel4);
    jTextField3.setText("");
    jPanel1c.add(jTextField3);
    jLabel5.setText("Please enter the run number (1or 2) in cell F3");
    jPanel1c.add(jLabel5);
    jPanel1.add(jPanel1c);
    jLabel6.setText(" Temperature of room where assay was run(C) ");
    jPanel1d.add(jLabel6);
    jTextField4.setText("");
    jPanel1d.add(jTextField4);
    jLabel7.setText("Outside Recommended Range(18-27)!");
    jPanel1d.add(jLabel7);
    jPanel1.add(jPanel1d);
    getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
    jPanel3.setLayout(new java.awt.BorderLayout());
    jLabel10.setText("Enter OD Values according to Figure 1");
    jPanel3a.add(jLabel10);
    // jPanel3.add(jPanel3a, java.awt.BorderLayout.NORTH );
    jPanel3.add(jLabel10, java.awt.BorderLayout.NORTH );
    jTable3.setModel(new javax.swing.table.DefaultTableModel(
    new Object [][] {
    {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
    {"A", null, null, null, null, null, null, null, null, null, null, null, null},
    {"B", null, null, null, null, null, null, null, null, null, null, null, null},
    {"C", null, null, null, null, null, null, null, null, null, null, null, null},
    {"D", null, null, null, null, null, null, null, null, null, null, null, null},
    {"E", null, null, null, null, null, null, null, null, null, null, null, null},
    {"F", null, null, null, null, null, null, null, null, null, null, null, null},
    {"G", null, null, null, null, null, null, null, null, null, null, null, null},
    {"H", null, null, null, null, null, null, null, null, null, null, null, null}
    new String [] {
    "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6", "Title 7", "Title 8", "Title 9", "Title 10", "Title 11", "Title 12", "Title 13"
    Class[] types = new Class [] {
    java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
    public Class getColumnClass(int columnIndex) {
    return types [columnIndex];
    jPanel3b.add(jTable3);
    jPanel3b.add(jPanel12);
    jPanel3.add(jPanel3b, java.awt.BorderLayout.CENTER);
    getContentPane().add(jPanel3, java.awt.BorderLayout.SOUTH);
    jPanel2.setLayout(new java.awt.GridLayout(2, 0));
    jPanel2a.setLayout(new java.awt.BorderLayout());
    jLabel8.setText("Figure 1. Sample Layout");
    jPanel2aa.add(jLabel8);
    jPanel2a.add(jPanel2aa, java.awt.BorderLayout.NORTH );
    DefaultTableModel dm = new DefaultTableModel()
    public Class getColumnClass(int columnIndex)
              return String.class;
    dm.setDataVector(new Object [][] {
    {"A", "0% STD\nRep 1","0% STD\nRep 2","0.3% STD\nRep 1","0.3% STD\nRep 2","1.25% STD\nRep 1","1.25% STD\nRep 2","2.5% STD\nRep 1","2.5% STD\nRep 2","Sample1\nRep 1","Sample1\n Rep2","Sample2\nRep 1","Sample2\n Rep 2"},
    {"B", "Sample3\nRep 1","Sample3\n Rep 2", "Sample4\nRep 1","Sample4\n Rep 2", "Sample5\nRep 1","Sample5\n Rep 2", "Sample6\nRep 1","Sample6\n Rep 2", "Sample7\nRep 1","Sample7\n Rep 2", "Sample8\nRep 1","Sample8\n Rep 2"},
    {"C", "Sample9\nRep 1","Sample9\n Rep 2", "Sample10\nRep 1","Sample10\n Rep 2", "Sample11\nRep 1","Sample11\n Rep 2", "Sample12\nRep 1","Sample12\n Rep 2", "Sample13\nRep 1","Sample13\n Rep 2", "Sample14\nRep 1","Sample14\n Rep 2"},
    {"D", "Sample15\nRep 1","Sample15\n Rep 2", "Sample16\nRep 1","Sample16\n Rep 2", "Sample17\nRep 1","Sample17\n Rep 2", "Sample18\nRep 1","Sample18\n Rep 2", "Sample19\nRep 1","Sample19\n Rep 2", "Sample20\nRep 1","Sample21\n Rep 2"},
    {"E", "Sample21\nRep 1","Sample21\n Rep 2", "Sample22\nRep 1","Sample22\n Rep 2", "Sample23\nRep 1","Sample23\n Rep 2", "Sample24\nRep 1","Sample24\n Rep 2", "Sample25\nRep 1","Sample25\n Rep 2", "Sample26\nRep 1","Sample26\n Rep 2"},
    {"F", "Sample27\nRep 1","Sample27\n Rep 2", "Sample28\nRep 1","Sample28\n Rep 2", "Sample29\nRep 1","Sample29\n Rep 2", "Sample30\nRep 1","Sample30\n Rep 2", "Sample31\nRep 1","Sample31\n Rep 2", "Sample32\nRep 1","Sample32\n Rep 2"},
    {"G", "Sample33\nRep 1","Sample33\n Rep 2", "Sample34\nRep 1","Sample34\n Rep 2", "Sample235\nRep 1","Sample35\n Rep 2", "Sample36\nRep 1","Sample36\n Rep 2", "Sample37\nRep 1","Sample37\n Rep 2", "Sample38\nRep 1","Sample38\n Rep 2"},
    {"H", "Sample39\nRep 1","Sample39\n Rep 2", "Sample40\nRep 1","Sample40\n Rep 2", "Sample41\nRep 1","Sample41\n Rep 2", "Sample42\nRep 1","Sample42\n Rep 2", "Sample43\nRep 1","Sample43\n Rep 2", "Sample44\nRep 1","Sample44\n Rep 2"},
    new String [] {" ", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"});
    jTable1 = new JTable( dm );
    int lines = 2;
    jTable1.setRowHeight( jTable1.getRowHeight() * lines);
    jTable1.setDefaultRenderer(String.class, new MultiLineCellRenderer());
    jPanel2ab.add(jTable1);
    jPanel2a.add(jPanel2ab, java.awt.BorderLayout.CENTER);
    jPanel2.add(jPanel2a);
    jLabel9.setText("Enter the Sample Identification Number according to Figure 1");
    jPanel2ba.add(jLabel9);
    jPanel2b.add(jPanel2ba,java.awt.BorderLayout.NORTH);
    // jPanel2bb.setLayout(new java.awt.BorderLayout());
    jTable2.setModel(new javax.swing.table.DefaultTableModel(
    new Object [][] {
    {null, "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
    {"A", null, null, null, null, null, null, null, null, null, null, null, null},
    {"B", null, null, null, null, null, null, null, null, null, null, null, null},
    {"C", null, null, null, null, null, null, null, null, null, null, null, null},
    {"D", null, null, null, null, null, null, null, null, null, null, null, null},
    {"E", null, null, null, null, null, null, null, null, null, null, null, null},
    {"F", null, null, null, null, null, null, null, null, null, null, null, null},
    {"G", null, null, null, null, null, null, null, null, null, null, null, null},
    {"H", null, null, null, null, null, null, null, null, null, null, null, null}
    new String [] {
    "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6", "Title 7", "Title 8", "Title 9", "Title 10", "Title 11", "Title 12", "Title 13"
    jPanel2bb.add(jTable2);
    jPanel2b.add(jPanel2bb, java.awt.BorderLayout.CENTER);
    jPanel2.add(jPanel2b);
    getContentPane().add(jPanel2, java.awt.BorderLayout.CENTER);
    pack();
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
    System.exit(0);
    * @param args the command line arguments
    public static void main(String args[]) {
    new Graph_Page_I().show();
    /** MultiLineCellRenderer prgram **/
    import javax.swing.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    import java.awt.*;
    public class MultiLineCellRenderer extends JTextArea implements TableCellRenderer {
    public MultiLineCellRenderer() {
    setLineWrap(true);
    setWrapStyleWord(true);
    setOpaque(true);
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
         if (isSelected)
         setForeground(table.getSelectionForeground());
         setBackground(table.getSelectionBackground());
         else
         {      setForeground(table.getForeground());
              setBackground(table.getBackground());
         } setFont(table.getFont());
         if (hasFocus)
              setBorder( UIManager.getBorder("Table.focusCellHighlightBorder") );
              if (table.isCellEditable(row, column))
              setForeground( UIManager.getColor("Table.focusCellForeground") );
              setBackground( UIManager.getColor("Table.focusCellBackground") );
         else
         {      setBorder(new EmptyBorder(1, 2, 1, 2));
         setText((value == null) ? "" : value.toString());
              return this;

    Hi,
    You defined in a hard way rather than doing it in a simple way. I felt you are using more panels. If I find anything else or if I come across a good way..I will let you know.

  • Help: JPanel/JFrame display complexities, wrong size

    I am trying to make a simple game of worms.I wan't to draw a rectangle in the center of the window where in the middle the game is played and on the outside score, lives and other such things are displayed. The problem is the rectangle won't draw properly because the window is the wrong size and I don't know if it is something I am doing wrong with the panel or frame.
    import javax.swing.*;
    import java.awt.*;
    public class DemoWormPanel extends JPanel implements Runnable{
        private static final int WIDTH = 600, HEIGHT = 400;
        private Graphics dbG;
        private Image dbImage;
        private Thread animator;
        private boolean running = false;
        private Rectangle walls;
        public DemoWormPanel() {
            super();
            setSize(WIDTH,HEIGHT);
        public void startGame() {
            if (animator == null) {
                animator = new Thread(this);
                animator.start();
            running = true;
            //defining game walls at 50 pixels within panel border
            walls = new Rectangle(50, 50, WIDTH - 50, HEIGHT - 50);
        public void gameRender() {
            if (dbImage == null) {
                dbImage = createImage(WIDTH, HEIGHT);
                if (dbImage == null) {
                    System.out.println("Error creating double buffer");
                    System.exit(0);
                dbG = dbImage.getGraphics();
            dbG.setColor(Color.black);
            dbG.fillRect(0,0,WIDTH,HEIGHT);
            dbG.setColor(Color.white);
            dbG.drawRect(walls.x, walls.y, walls.width, walls.height);
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            g.drawImage(dbImage, 0, 0, this);
            g.dispose();
        public void update(Graphics g){
            paint(g);
        public void run() {
            while (running) {
                gameRender();
                repaint();
                try {
                    Thread.sleep(1000/50);
                } catch (InterruptedException e) {}
            System.exit(0);
        public static void main(String[] args) {
            DemoWormPanel wp = new DemoWormPanel();
            JFrame f = new JFrame();
            f.setTitle("Worms");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(wp);
            f.setSize(WIDTH, HEIGHT);
            f.setVisible(true);
            wp.startGame();
    }Somewhere in there is my problem.
    What happens is that the right and bottom walls of the Rectangle are cut off of the screen because the window is not the right size. I changed the code to determine if the coordinates of the walls were accurate every iteration and they were. I also made it check the width and height every iteration by printing out this.getWidth() and this.getHeight() and found that instead of a 600 x 400 window, I have a 584 x 364. I also tried changing the panel and frame's size methods to make a new dimension instead of setting it directly from my constants and it had no effect. I also added directly to those constants to make it precisely 600 x 400 but the rectangle is still cut off, so maybe I also have a graphics issue. The only other potential issue I can think of is that I have Vista but I looked around here and searched google and found no similar issues to this.
    I am not new to java but I am also not advanced. I just started using java again after about 6 months and I have made a pong game before without this problem, on another computer though.I am at my wits end. I'll check for responses tomorrow and thank you for any help or insight you can offer.

    the problem is here
    walls = new Rectangle(50, 50, WIDTH - 50, HEIGHT - 50);
    at best the right/bottom walls will equal the frame's dimensions. try it as
    walls = new Rectangle(50, 50, WIDTH - 100, HEIGHT - 100);
    but this won't get you exactly what you want, due to the titlebar height (30?)
    slightly different version
    import javax.swing.*;
    import java.awt.*;
    class DemoWormPanel extends JPanel {
        private static final int WIDTH = 600, HEIGHT = 400;
        public DemoWormPanel() {
            setBackground(Color.BLACK);
            setPreferredSize(new Dimension(WIDTH-100,HEIGHT-100));
        public static void main(String[] args) {
            DemoWormPanel wp = new DemoWormPanel();
            JFrame f = new JFrame();
            f.setLayout(new GridBagLayout());
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(wp,new GridBagConstraints());
            f.setSize(WIDTH, HEIGHT);
            f.setVisible(true);
    }

  • JFrame displays without its components or settings (please help)

    On clicking a button in an app, due to computational time required, I need to have a message popup that says 'Please Wait', which vanishes on end of needed computation. For this, I have a small working class MsgDiag that simply displays a non-modal titled JFrame showing a message string in a JLabel and an 'ok' in a JButton. This works fine when invoked directly via its own main method as a standalone, but when called from that other application(also a extended JFrame) via button click, it just brings up a blank grey untitled JFrame without the components (JLabel and JButton) or the background color! It does stay up for the required duration and vanishes on disposing its JFrame as expected but why blank w/o components or settings ?
    I also find that though the JFrame component comes up blank grey, if during the computation portion in calling application, if any info/errors are popped up via direct call to a JOptionPane().showMessageDialog(JFrame(),msgString, titleString, msgType), then along with that modal popup (from JOptionPane), the grey JFrame gets correctly drawn with components and background !
    Does this provide any hints ? Since MsgDiag works ok by itself I am puzzled.
    I also tried putting basic code from MsgDiag (creating JFrame, adding its components, setting it visible etc) into the other app directly but same grey blank frame results. Had there been a non-modal JOptionPane I could have tried using it. I use JRE 1.4.2

    Per your suggestion, I tried putting computational part in a different thread. Also tried putting the thread priority for computational thread to lowest.
    In other approach, also tried putting the GUI popup (frame2) in a separate thread with highest priority while lowest priority computational thread executed. But neither approach worked. Still shows frame2 as blank w/o background or components inside while low priority computational thread finished, when frame2 gets disposed as instructed.
    In 1st approach, also tried adding validate() following setSize() as some other posts have suggested but that did not change anything. Any other pointers ?

  • New JFrame display: lagtime...

    hi,
    here is a snipit of code...
    else
                    //create new frame
                    SearchBox sb =new SearchBox();
                    sb.setVisible(true);
                    Driver d= new Driver(usernam, pw, cl, ur);
                            d.setUp(search.getText().toUpperCase());
                   sb.dispose();
               }and SearchBox is...
    public class SearchBox extends JFrame {
         public SearchBox()
            super("Image as BG");
            JLabel label = new JLabel(new ImageIcon("search.gif"));
            JPanel panel = new JPanel();
            panel.add(label);
            setContentPane(panel);
            pack();
            setVisible(true);
    }Problem?
    Well before I create an instance of Driver, and then call the setUp() method, I create this SearchBox instance. This SHOULD display the animated GIF. The animated GIF doesnt display until after d.setUp. (note setUp() takes about a minute to run- it connects to an oracle db etc..... hense the need for thr animated gif to inform the user of the search,
    I DON'T want to use threads!
    litkid

    Hi.
    Sorry to disappoint you, but this can not work without threads. Here's why:
    //create new frame
    SearchBox sb =new SearchBox();
    sb.setVisible(true);
    Driver d= new Driver(usernam, pw, cl, ur);
                            d.setUp(search.getText().toUpperCase());
    sb.dispose();It seems to me this entire part is executed by the AWTThread, which is completely normal in any gui application. The AWTThread will be the one repainting your gif as soon as it is finished doing it's other work, which includes your loading operation. However, using a separate thread is not that complicated:
    //create new frame
    final SearchBox sb =new SearchBox();
    sb.setVisible(true);
    Thread t=new Thread(){
        public void run(){
           Driver d= new Driver(usernam, pw, cl, ur);
           d.setUp(search.getText().toUpperCase());
           sb.dispose();
    t.start();This should do the trick.
    sarcan

  • Applet, JFrame: Display icons in toolbar

    Hello,
    I've a class called Designer which extends Applet. In the init method two JFrames are opened: DesignerFrame and DrawPanel. In the DesignerFrame I have a toolbar with icons. When I run the Applet in Eclipse (on my local computer) he shows the icons. When I put the application on my webserver, and I open it with my browser on my local computer, he doesn't show the icons. The icons are in a folder called pwdImages.
    Does anyone know how to solve this problem?
    Thanks a lot!!!
    Koen.

    Hello,
    Thanks for the answers. Here's some code of the DesignerFrame class:
    // Handles color menu items
         class ColorAction extends AbstractAction {
              public ColorAction(String name, Color color) {
                   super(name);
                   this.color = color;
                   String iconFileName = "pwdImages/" + name + ".gif";
                   if (new File(iconFileName).exists())
                        putValue(SMALL_ICON, new ImageIcon(iconFileName));
              public ColorAction(String name, Color color, String tooltip) {
                   this(name, color);
                   if (tooltip != null) // If there is a tooltip
                        putValue(SHORT_DESCRIPTION, tooltip); // ...squirrel it away
              public void actionPerformed(ActionEvent e) {
                   elementColor = color;
                   statusBar.setColorPane(color);
              private Color color;
    addMenuItem(
                   colorMenu,
                   redAction = new ColorAction("Red", Color.RED, "Draw in red"));
    // Element color actions
         private ColorAction redAction, yellowAction, greenAction, blueAction;
    ...

  • Getting a JFrame to display  from a JSP, remaining JSP code waits for frame

    Hello,
    I'm new to Java and just started using JSPs. My objective is to call a display window (from a JSP) that shows the user a list of project selections. Once the user has made their selections and clicked a Submit button, the display class captures the selected projects to the request object as an attribute and then closes the window. The next command in the jsp then forwards the request attribute to a controller. I'm having trouble getting the display window to show-the JSP seems to hang and then timeout. Is there code I'm missing to get the JSP to stop processing while it waits for the choices to be made in the JFrame?
    Below is the JSP code and the class I'm calling. I'm seeing all my debug System.out statements but no JFrame pops up. In the JFrame class, the line f.addWindowListener(... does the capture of user selections to the request attribute.
    Any help will be greatly appreciated!!
    JSP:
    <%@ page language="java" contentType="text/html;charset=UTF-8" import="com.plumtree.remote.portlet.*,edu.app.projects.*" %>
    <%
        request.setAttribute("action", "prefDisplay");
        request.setAttribute("orderby", "title");
        ServletContext jc = getServletContext();
        DualListBox dual = new DualListBox(request,(String)jc.getAttribute("db.driver"), (String)jc.getAttribute("db.connectionstring"),"title");
         JFrame f = dual.getFrame();
         f.setVisible(true);//expect code to stop here and display frame, waiting for the user to finish.
            //Debug code that tests if frame is visible at this point -came true though did not see Jframe displayed
         if(f.isShowing()){
         System.out.println("Jframe visible");}
           //Send to ProjectsController
          request.getRequestDispatcher("pc").forward(request, response);%>               ---------------------------------------------------------------------------------------------
    JFrame Class (below)
    -Sets up Frame and corresponding Dialog box
    -Populates Dialog box with options from a database call (for user selection)
    -Should wait for user input - Window close or Submit! to capture selection and dispose of Jframe
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.EventQueue;
    import java.awt.Frame;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowEvent;
    import java.lang.reflect.InvocationTargetException;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Collection;
    import java.util.Iterator;
    import java.util.SortedSet;
    import java.util.TreeSet;
    import javax.servlet.http.HttpServletRequest;
    import javax.swing.AbstractListModel;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.ListCellRenderer;
    import javax.swing.ListModel;
    public class DualListBox extends JPanel {
      private static final long serialVersionUID = 1L;
      private static final Insets EMPTY_INSETS = new Insets(0, 0, 0, 0);
      private static final String ADD_BUTTON_LABEL = "Add >>";
      private static final String REMOVE_BUTTON_LABEL = "<< Remove";
      private static final String DONE_BUTTON_LABEL = "Submit!";
      private static final String DEFAULT_SOURCE_CHOICE_LABEL = "Available Projects";
      private static final String DEFAULT_DEST_CHOICE_LABEL = "Your Selections";
      private String orderby, mydriver, connectionString;
      private JLabel sourceLabel;
      private JList sourceList;
      private SortedListModel sourceListModel;
      private JList destList;
      private String chosenprojects;
      private SortedListModel destListModel;
      private JLabel destLabel;
      private JButton addButton;
      private JButton removeButton;
      private JButton doneButton;
      private DatabaseHelper dh;
      protected HttpServletRequest request;
      protected JFrame f;
      protected JDialog jd;
      public DualListBox(HttpServletRequest req, String driver, String connection, String ordering) {
         System.out.println("In DualList Setup");
        request =req;
         orderby =ordering;
         connectionString = connection;
         mydriver = driver;
         f = new JFrame("Projects List Selector");     
         jd =new JDialog(f,true);
         jd.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
         System.out.println("B4 initscreen");
        initScreen();
        System.out.println("After initscreen");
        String[] DBprojects = this.dbCall();
        System.out.println("After DB Call");
        this.addSourceElements( DBprojects );   
        System.out.println("Filled screen");
        jd.getContentPane().add(this, BorderLayout.CENTER);
        //f.getContentPane().add(jd, BorderLayout.CENTER);
        jd.setSize(800, 600);
        System.out.println("OK2");
        jd.setVisible(true);
        System.out.println("OK3");
        Runnable runner = new FrameShower(jd);
        EventQueue.invokeLater(runner);
      public String getSourceChoicesTitle() {
        return sourceLabel.getText();
      public String chosenprojects() {
             return chosenprojects;
      public JFrame getFrame() {
             return f;
      public void setSourceChoicesTitle(String newValue) {
        sourceLabel.setText(newValue);
      public String getDestinationChoicesTitle() {
        return destLabel.getText();
      public void setDestinationChoicesTitle(String newValue) {
        destLabel.setText(newValue);
      public void clearSourceListModel() {
        sourceListModel.clear();
      public void clearDestinationListModel() {
        destListModel.clear();
      public void addSourceElements(ListModel newValue) {
        fillListModel(sourceListModel, newValue);
      public void setSourceElements(ListModel newValue) {
        clearSourceListModel();
        addSourceElements(newValue);
      public void addDestinationElements(ListModel newValue) {
        fillListModel(destListModel, newValue);
      private String[] dbCall(){
             if(dh==null)
                  dh = new DatabaseHelper(mydriver, connectionString);
              PreparedStatement ps = null;
              ResultSet rs = null;
              ArrayList<String>children = new ArrayList<String>();
              ArrayList<String[]>tree =new ArrayList<String[]>();
              if(orderby==null || orderby.equals("")){
                   orderby ="region";
              String query = "select title,id from projects";// order by " + orderby;
              System.out.println(query);
              try {
                   Connection conn =dh.getConnection();
                   ps = conn.prepareStatement(query);
                   rs = ps.executeQuery();
                   while (rs.next()) {
                        children.add(new String(rs.getString(1)));
                        System.out.println(rs.getString(1));
                        tree.add(new String[]{rs.getString(1),rs.getString(2)});
                   request.setAttribute("ResultTree",tree);
                   return (String[])children.toArray(new String[children.size()]);
              } catch (SQLException e) {
                   throw new RuntimeException(e);
              } finally {
                   try {
                        if (null != rs) rs.close();
                   } catch (SQLException e) {
                   try {
                        if (null != ps) ps.close();
                   } catch (SQLException e) {
      private void fillListModel(SortedListModel model, ListModel newValues) {
        int size = newValues.getSize();
        for (int i = 0; i < size; i++) {
          model.add(newValues.getElementAt(i));
      public void addSourceElements(Object newValue[]) {
        fillListModel(sourceListModel, newValue);
      public void setSourceElements(Object newValue[]) {
        clearSourceListModel();
        addSourceElements(newValue);
      public void addDestinationElements(Object newValue[]) {
        fillListModel(destListModel, newValue);
      private void fillListModel(SortedListModel model, Object newValues[]) {
        model.addAll(newValues);
      public Iterator sourceIterator() {
        return sourceListModel.iterator();
      public Iterator destinationIterator() {
        return destListModel.iterator();
      public void setSourceCellRenderer(ListCellRenderer newValue) {
        sourceList.setCellRenderer(newValue);
      public ListCellRenderer getSourceCellRenderer() {
        return sourceList.getCellRenderer();
      public void setDestinationCellRenderer(ListCellRenderer newValue) {
        destList.setCellRenderer(newValue);
      public ListCellRenderer getDestinationCellRenderer() {
        return destList.getCellRenderer();
      public void setVisibleRowCount(int newValue) {
        sourceList.setVisibleRowCount(newValue);
        destList.setVisibleRowCount(newValue);
      public int getVisibleRowCount() {
        return sourceList.getVisibleRowCount();
      public void setSelectionBackground(Color newValue) {
        sourceList.setSelectionBackground(newValue);
        destList.setSelectionBackground(newValue);
      public Color getSelectionBackground() {
        return sourceList.getSelectionBackground();
      public void setSelectionForeground(Color newValue) {
        sourceList.setSelectionForeground(newValue);
        destList.setSelectionForeground(newValue);
      public Color getSelectionForeground() {
        return sourceList.getSelectionForeground();
      public String getProjects(){
           return chosenprojects;
      private void clearSourceSelected() {
        Object selected[] = sourceList.getSelectedValues();
        for (int i = selected.length - 1; i >= 0; --i) {
          sourceListModel.removeElement(selected);
    sourceList.getSelectionModel().clearSelection();
    private void clearDestinationSelected() {
    Object selected[] = destList.getSelectedValues();
    for (int i = selected.length - 1; i >= 0; --i) {
    destListModel.removeElement(selected[i]);
    destList.getSelectionModel().clearSelection();
    private void initScreen() {
    setBorder(BorderFactory.createEtchedBorder());
    setLayout(new GridBagLayout());
    sourceLabel = new JLabel(DEFAULT_SOURCE_CHOICE_LABEL);
    sourceListModel = new SortedListModel();
    sourceList = new JList(sourceListModel);
    add(sourceLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0,
    GridBagConstraints.CENTER, GridBagConstraints.NONE,
    EMPTY_INSETS, 0, 0));
    add(new JScrollPane(sourceList), new GridBagConstraints(0, 1, 1, 5, .5,
    1, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    EMPTY_INSETS, 0, 0));
    addButton = new JButton(ADD_BUTTON_LABEL);
    add(addButton, new GridBagConstraints(1, 2, 1, 2, 0, .25,
    GridBagConstraints.CENTER, GridBagConstraints.NONE,
    EMPTY_INSETS, 0, 0));
    addButton.addActionListener(new AddListener());
    removeButton = new JButton(REMOVE_BUTTON_LABEL);
    add(removeButton, new GridBagConstraints(1, 4, 1, 2, 0, .25,
    GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(
    0, 5, 0, 5), 0, 0));
    removeButton.addActionListener(new RemoveListener());
    doneButton = new JButton(DONE_BUTTON_LABEL);
    add(doneButton, new GridBagConstraints(1, 6, 1, 2, 0, .25,
    GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(
    0, 10, 0, 10), 0, 0));
    doneButton.addActionListener(new DoneListener());
    f.addWindowListener(new java.awt.event.WindowAdapter() {
         public void windowClosing(WindowEvent winEvt) {
              //could set to null here to force use of Done button only
         chosenprojects = destList.getSelectedValues().toString();
              request.setAttribute("ProjectIDs", destList.getSelectedValues().toString());
              System.exit(0);
    destLabel = new JLabel(DEFAULT_DEST_CHOICE_LABEL);
    destListModel = new SortedListModel();
    destList = new JList(destListModel);
    add(destLabel, new GridBagConstraints(2, 0, 1, 1, 0, 0,
    GridBagConstraints.CENTER, GridBagConstraints.NONE,
    EMPTY_INSETS, 0, 0));
    add(new JScrollPane(destList), new GridBagConstraints(2, 1, 1, 5, .5,
    1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
    EMPTY_INSETS, 0, 0));
    private class AddListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    Object selected[] = sourceList.getSelectedValues();
    addDestinationElements(selected);
    clearSourceSelected();
    private class RemoveListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    Object selected[] = destList.getSelectedValues();
    addSourceElements(selected);
    clearDestinationSelected();
    private class DoneListener implements ActionListener {
         public void actionPerformed(ActionEvent e) {
         chosenprojects = destList.getSelectedValues().toString();
         request.setAttribute("ProjectIDs", destList.getSelectedValues().toString());
         System.exit(0);      
    class FrameShower implements Runnable {
         final JDialog frame;
         public FrameShower(JDialog frame) {
              this.frame = frame;
         public void run() {
              System.out.println("B4 make visible");
              frame.setVisible(true);          
         System.out.println("Made screen visible");
    class SortedListModel extends AbstractListModel {
    private static final long serialVersionUID = 8777627817685130496L;
    SortedSet model;
    public SortedListModel() {
    model = new TreeSet();
    public int getSize() {
    return model.size();
    public Object getElementAt(int index) {
    return model.toArray()[index];
    public void add(Object element) {
    if (model.add(element)) {
    fireContentsChanged(this, 0, getSize());
    public void addAll(Object elements[]) {
    Collection c = Arrays.asList(elements);
    model.addAll(c);
    fireContentsChanged(this, 0, getSize());
    public void clear() {
    model.clear();
    fireContentsChanged(this, 0, getSize());
    public boolean contains(Object element) {
    return model.contains(element);
    public Object firstElement() {
    return model.first();
    public Iterator iterator() {
    return model.iterator();
    public Object lastElement() {
    return model.last();
    public boolean removeElement(Object element) {
    boolean removed = model.remove(element);
    if (removed) {
    fireContentsChanged(this, 0, getSize());
    return removed;
    }{code}
    Edited by: redm14A on Oct 10, 2007 11:34 AM
    Edited by: redm14A on Oct 10, 2007 11:37 AM
    Edited by: redm14A on Oct 10, 2007 11:40 AM
    Edited by: redm14A on Oct 10, 2007 11:45 AM
    Edited by: redm14A on Oct 10, 2007 11:47 AM

    redm14A wrote:
    Hmm, I was trying to avoid writing an applet. Seems my only other option then is to write a JSP that returns a javascript menu populated by options from a database call. Then I'd have the user click submit to send the options to another JSP that simply sets the request attribute and forwards to the controller. Will this be a sound alternative?
    Edited by: redm14A on Oct 10, 2007 12:29 PMSounds good to me.

  • Adjusting a display while JFrame is being resized

    I have a JFrame displaying several JComponents
    I need to adjust the layout of these components CONTINUOUSLY while the user is in MIDDLE of resizing the JFrame.
    The LayoutManager.layoutContainer() method
    only gets called AFTER the user is finished resizing the JFrame
    the ComponentListener.componentResized() event also
    gets called after the resizing is done.
    How can I know when the user is in middle of resizing his JFrame?

    Look at this threads:
    http://forum.java.sun.com/thread.jsp?forum=4&thread=203557
    http://forum.java.sun.com/thread.jsp?forum=5&thread=146550

  • How to Load a wav file into a JFrame

    Ok, I have a JFrame with a JPanel and JButtons, play, pause, stop....etc...I have a menu with items load song and exit. Now when you click file load song, it pops up a JFileChooser.....that all works fine. Now I want to be able to select a wav file from that file chooser and have it load into the JFrame, displaying the name of the song in the JPanel...as a JLabel or whatever. Also how can I make the buttons, play pause stop, etc. work with the song. I.E. when i press play, the song plays, stop the song stops...any ideas?

    Create a JLabel with the filename as its text. Add the JLabel onto your JPanel. Add the JPanel
    onto the JFrame. Call setVisible(true) on the JFrame. For Java GUI basics, study:
    http://java.sun.com/docs/books/tutorial/uiswing/index.html
    For wav file playing:
    String filename = "foo.wav";
    java.applet.AudioClip clip
    = java.applet.Applet.newAudioClip(new File(filename).toURI().toURL());
    clip.play();

  • How to create a pie diagram and display it in html code

    hii frds,
    happy 2 meet u all.
    I want to know how to create a pie diagram that should not be devleloped by using applet, and use it in the html code to display a pie diagram in browser.
    ex code:
    package temp;
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.JFrame;
    public class Dummy1 extends Panel {
    BufferedImage image;
         int a1,a2,l,t,w,h;
    public Dummy1()
              try
    a1=90;
              a2=210;
              l=10;
              t=10;
              w=200;
              h=200;
    } catch (Exception ie) { System.out.println("Error:"+ie.getMessage());  }
    public void paint(Graphics g) {
    // g.drawImage( image, 0, 0, null);
    g.setColor(Color.green);
              g.fillArc(l,t,w,h,0,a1);
    g.setColor(Color.red);
              g.fillArc(l,t,w,h,a1,(a2-a1));
         g.setColor(Color.blue);
              g.fillArc(l,t,w,h,a2,(360-a2));
              System.out.println("in paint");
              image=(Image)g.getGraphics();
    public JFrame getMyFrame()
    JFrame frame=null;
              try
    frame = new JFrame("Display image");
    Panel panel = new Dummy1();
    frame.getContentPane().add(panel);
    frame.setSize(500, 500);
    // frame.setVisible(true);
    // frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              }catch(Exception e) { e.printStackTrace(); }
              return frame;
    static public void main(String args[]) throws
    Exception {
    JFrame frame = new JFrame("Display image");
    Panel panel = new Dummy1();
    frame.getContentPane().add(panel);
    frame.setSize(500, 500);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    - > with out using <applet> in html can't we display the awt grahics in browser.
    plz clarify my doubts.
    thank you.
    regards
    moons..

    If you are using MSSQL SERVER then try creating a stored procedure like this
    create proc Name
    select * from Table
    by executing this in sql query analyzer will create a stored procedure that returns all the data from Table
    here is the syntax to create SP
    Syntax
    CREATE PROC [ EDURE ] procedure_name [ ; number ]
        [ { @parameter data_type }
            [ VARYING ] [ = default ] [ OUTPUT ]
        ] [ ,...n ]
    [ WITH
        { RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]
    [ FOR REPLICATION ]
    AS sql_statement [ ...n ]
    Now Create new report and create new connection to your database and select stored procedure and add it to the report that shows all the columns and you can place the required fields in the report and refresh the report.
    Regards,
    Raghavendra
    Edited by: Raghavendra Gadhamsetty on Jun 11, 2009 1:45 AM

  • Jframe Help

    Hi There,I wonder if anyone can help me. I currently have to Jframe displayed in a card layout. I would like to display it as one JFrame, with thediferrent layouts that would normally be in each Jframe put into one frame seperated by a "next" button, rather like a wizard setup. Can anyone give me any advice on how to do this? Here is my code for the JFrame, which is currently displayed twice:
    import java.text.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.UIManager;
    public class StartFrame extends JFrame implements ActionListener, ItemListener
          private JComboBox typeOfPlayer;
          JPanel cards; //a panel that uses CardLayout  
          final static String SELECT_USER = "Please select the type of player";
         final static String HUMAN = "Human"; 
         final static String COMPUTER = "Computer";
        private JButton select; 
        private Player play;
        private JComboBox cb; 
       private JTextField name;  
       private boolean isSubmitted;   
    public StartFrame(Player p)
          setDefaultCloseOperation(DISPOSE_ON_CLOSE);
          setSize(200, 300); 
          play = p;   
          isSubmitted = false;   
      try  
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
      catch (Exception e) 
                  UIManager.getSystemLookAndFeelClassName();    
       //Create and set up the content pane.  
      addComponentToPane(this.getContentPane()); 
      //Display the window.  
      this.pack();   
      this.setVisible(true);
      public void addComponentToPane(Container pane) 
    //Put the JComboBox in a JPanel to get a nicer look. 
    JPanel comboBoxPane = new JPanel(); //use FlowLayout    
    String comboBoxItems[] =      { SELECT_USER, HUMAN, COMPUTER };  
    cb = new JComboBox(comboBoxItems); 
    cb.setEditable(false);  
    cb.addItemListener(this);   
    comboBoxPane.add(cb);         
      //Create the "cards".            JPanel card1 = new JPanel();   
      JPanel card2 = new JPanel();  
       String levels[] =      {"Beginner", "intermediate", "expert"};  
       JComboBox levelOfDifficulty = new JComboBox(levels);  
       card2.add(new JLabel("Select Level"));   
      card2.add(levelOfDifficulty);   
      select = new JButton("select");  
       select.addActionListener(this);  
       card2.add(select);          
       JPanel card3 = new JPanel();  
       card3.add(new JLabel("Enter name")); 
       name = new JTextField(20);
       card3.add(name);   
      select = new JButton("select");   
      select.addActionListener(this); 
      card3.add(select);   
    //Create the panel that contains the "cards".    
    cards = new JPanel(new CardLayout());   
      cards.add(card1, SELECT_USER);
      cards.add(card2, COMPUTER);      cards.add(card3, HUMAN);  
      pane.add(comboBoxPane, BorderLayout.PAGE_START);   
      pane.add(cards, BorderLayout.CENTER); 
    public void itemStateChanged(ItemEvent evt)
      CardLayout cl = (CardLayout)(cards.getLayout());
         cl.show(cards, (String)evt.getItem()); 
    public void actionPerformed(ActionEvent ae) 
      if(ae.getSource() == select)   
         if (cb.getSelectedItem()=="Human")     
              System.out.println("human");//   
            play = new HumanPlayer();//  
             play.setName(name.getText());     
       else if (cb.getSelectedItem()=="Computer")  
      System.out.println("Computer");  
             play.setName("Computer");         
      isSubmitted = true;
        public boolean getIsSubmitted() 
        return isSubmitted; 
    }

    Hi,
    you can choose from a variety of things but a JTree would be the best.
    Regards
    Aakash

  • Why won't my Frame display?

    I know this is simple. If I change these components to awt (not swing) they display. As written, no labels display. Why?
        JFrame display = new JFrame("Printing Batched Reports");
        JLabel label   = new JLabel("Gathering Agencies To Report",JLabel.CENTER);
        JLabel label2  = new JLabel("Window will close when  complete.",JLabel.CENTER);
      // constructor
        public DisplayWindow()
          display.setSize(400,100);
          display.getContentPane().setSize(400,100);
          display.getContentPane().setLayout(new java.awt.GridLayout(2,1));
          display.getContentPane().add(label);
          display.getContentPane().add(label2);
          display.setVisible(true);
        }I get an empty frame.
    Thanks
    ST

    The setting size was an act of desparation. ;-)
    There must be something going on with threading. I'm using JFree to print. I'll just dumb it down to awt. It worked then. It doesn't have to do much but tell the story.
    Thanks for the sanity check.
    ST

  • Displaying JOptionPane in the background

    Hi,
    As per a topic I had posted some time back (see http://forum.java.sun.com/thread.jsp?forum=57&thread=215788), I had implemented a semi-modal option pane that blocks only the parent JFrame displaying the error.
    further to that, I have a new requirement. If the currently displaying JFrame is NOT the one for which the error is reported, I want the error to be reported at the back of the currently displayed JFrame, so that it does not force me to change JFrames (which happens when I click on OK, as the parent now gets the focus).
    I tried to find some point where I could call a toBack() on the option pane after show, but no luck.
    Any suggestions?
    Thanks,
    Shefali.

    Hi paternostro,
    Thanks for your reply. I found that the function processWindowEvent() is the best. You can check the event ID and if it is WindowEvent.WINDOW_ACTIVATED, then this frame has been activated, and I can set this somewhere to be used in some kind of check like getCurrentActiveFrame().equals(displayingOptionPane.getParent()).
    Thanks anyways.
    However, I now have a new problem. Now that I have identified how to check the parent frame, I use
    _oMessageDialog.show();
    if((_oCurrentFrame.equals(_oMessageDialog.getParent())) == false)
      _oMessageDialog.toBack();
    }This way, if the parent of the message dialog is not the currently active frame, it goes to the back. But show() calls toFront(), which actually paints the dialog over the current frames, and THEN puts it to the back, which causes a very visible flicker on my screen, that can not only be annoying, but can scare the poor user!
    Any suggestions here? I want the option pane to be displayed in the background, so I want to do the given check before calling show, and show should somehow display the option pane behind the current frame.
    Thanks a lot,
    Shefali

  • Graphics only display properly when acceleration turned down

    I have the latest netbeans/jdk bundle installed v4.1/5.0, the latest direct x 9.0c or whatever. ATI 9700 in my toshiba mobile desktop P35.
    A simple graphics draw arcs inside jpanel inside jframe displays distorted in full acceleration. The colors are all there but interlaced or offset or something.
    When I turn accelleration down 3 or 4 notches, so that directdraw is off, it looks fine.
    Any ideas?

    Matteo : I guess it is a good sign that only 2 of us have reported this minor glitch here . . . I may experiment with switching to a different desktop pattern and / or screen saver to see if it persists . . . also, since installing SL I have only done Sleep and of course restarts after getting the 10.6.1 update and a few others so I need to do an actual Shut Down and later start up fresh and see what happens.

  • Jframe Resizing issue

    Hello, I have a very nice and pretty JFrame displaying on my screen right now, and I have a resize method attached to the resize event, and after I have resized my jframe the event is fired. All very well. However, I only get one resize event, and that only occurrs after I release the mouse from resizing. I would like to get continuous resizing events while I am in the process of adjusting the jframe size.
    If I start to resize, and I move my mouse two pixels, then I want a resize event. If I move it another 10 pixels then I want another resize event or whatever. I am not overely concerned about how many I get, but I definitely want to receive more than one event at the end.
    Any ideas?

    I stumbled across a reference that may help you. Take a look at http://java.sun.com/j2se/1.4.2/docs/guide/awt/AWTChanges.html which is the AWT Enhancements in the JavaTM 2 SDK, v1.4 page. It says, among other things,
    Dynamic Layout During Resize
    The bugtraq report that corresponds to this change is: 4077991.
    Previously, dynamic window resizing wasn't supported on all platforms. For example, on Windows NT, with solid resize on, resizing a window recalculated the layout only when the drag was finished. This has been fixed in this release with the addition of the new desktop property awt.dynamicLayoutSupported. When dynamic layout is enabled, a Container continually lays out its components as it resizes. If disabled, the layout will be validated after resizing has finished.
    API changes to java.awt.Toolkit.
    public void setDynamicLayout(boolean dynamic)
    protected boolean isDynamicLayoutSet()
    public boolean isDynamicLayoutActive()

Maybe you are looking for

  • How to send Oracle AS report automatically by email

    Dear Gurus, I would like to generate a Oracle report automatically and send it by Email. so for that I am trying by using below command C:\home\BIN\rwclient server=rep_servername_FRHome report=C:\reportpath\report.rdf userid=username/password@aliasna

  • Changing Sharing & Permissions on a Mac OS Extended External Drive

    I'm using ChronoSync to back up to 4 external hard drives. Three of them were formatted as Mac OS Extended (Journaled), while the 4th is not journaled. On the journaled HD's, I can change the privileges for me, staff and everyone in Get Info; I can a

  • How to insert a record with date format field

    I tried to execute the query of the below but it showed error and hence i did research and found out i can add a date syntax in front to format it properly. INSERT INTO EMP (EmpNo, EmpName, Sex, DateOfBirth, Salary, DeptNo) VALUES ('E001', 'Alex', 'M

  • I feel stupid asking this but here goes...

    I upgraded to the new Numbers and when you save your spreadsheet and say your cursor is on row 500 column 10 and next time you open that spreadsheet how do you get back to that position without scrolling or paging down a million times?  In an Excel s

  • EA3 export table with SDO types

    Hi! I've tried export table from user (not mdsys) with mdsys.sdo_geometry column (build 1.5.0.53.04, tools export wizard, all checks except storage). got in log: SEVERE 40 0 oracle.dbtools.db.DBUtil ORA-31603: объект "SDO_ELEM_INFO_ARRAY" с типом TYP