1024 768

Hello Is it possible to make a video ouput with 1024/768 not 1440 1080
in premier element 8
Thank you for help
Philippe

No. 1024 x 768 is not an allowable size for MPEG2. For full detail see here: Wikipedia. We could help you better if you explain exactly what it is you want to do with the file.
To summarise the wikipedia article information on resolutions:
DVD Standards
The DVD-Video standard uses MPEG-2 video, but imposes some restrictions:
Allowed Dimensions 
720 × 480, 704 × 480, 352 × 480, 352 × 240 pixel (NTSC)
720 × 576, 704 × 576, 352 × 576, 352 × 288 pixel (PAL)
DVB Standards
Application-specific restrictions on MPEG-2 video in the DVB standard:
Allowed resolutions for SDTV:
720, 640, 544, 528, 480 or 352 × 480 pixel, 24/1.001, 24, 30/1.001 or 30 frame/s
352 × 240 pixel, 24/1.001, 24, 30/1.001 or 30 frame/s
720, 704, 544, 528, 480 or 352 × 576 pixel, 25 frame/s
352 × 288 pixel, 25 frame/s
For HDTV:
720 x 576 x 50 frame/s progressive (576p50)
1280 x 720 x 25 or 50 frame/s progressive (720p50)
1440 or 1920 x 1080 x 25 frame/s progressive (1080p25 = film mode)
1440 or 1920 x 1080 x 25 frame/s interlace (1080i50)
1920 x 1080 x 50 frame/s progressive (1080p50) possible future H.264/AVC format
ATSC Standards
ATSC allows the following video resolutions, aspect ratios, and frame/field rates:
1920 × 1080 pixel (16:9, square pixels), at 30p, 29.97p, 24p, 23.976p, 60i, 59.94i.
1280 × 720 pixel (16:9, square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, or 23.976p
704 × 480 pixel (4:3 or 16:9, non-square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, 23.976p, 60i, or 59.94i
640 × 480 pixel (4:3, square pixels), at 60p, 59.94p, 30p, 29.97p, 24p, 23.976p, 60i, or 59.94i
Cheers,
Neale
Insanity is hereditary, you get it from your children

Similar Messages

  • How can i set the resolution on my imac ''27 in to 1024*768?

    hello,
    i'm new to imac
    how can i set the resolution on my imac ''27 in to 1024*768?
    its only gives me to options
    1- 1280*720
    2-800*600
    thanks

    My mid-2011 27" iMac, ML 8.3 has 1024x768:

  • Tecra M5-106: Display with 1024 * 768 resolution is not clear

    I buy Toshiba Tecra M5-106, it is 14.1" screen.
    When i set the screen resolution to 1024 * 768, every thing comes not clear... also the fonts is not good. Could be the sharpness or other?
    Any one see this before, or have solution for this?
    Solving this is highly appreciated.
    Ragards,

    Hello Bualim,
    The M5 is a really great notebook with very good characteristics. There are versions of this notebook with a NVIDIA graphic card (NVIDIA® Quadro® NVS 110M 128 MB DDR2) and others with an INTEL chipset. I don't know which one your model has unless you post the model code that is printed under your notebook.
    According to some research I made, the native resolution of your monitor should be 1400x1050 so you should leave your notebook to work in this resolution rather than something lower like 1024x768.
    You might say, "the fontsize is too small in 1400x1050", nevertheless you should NOT change into lower resolution (the common procedure done on the old CRT Monitor) but have the size adjusted through Window's "Appearance settings" on the "Display properties". This is the right way to go on a TFT screen (notebook): Always keep the maximum (your native) resolution and adjust the size of icons and fonts through software settings within windows.
    Ok, getting back to your problem now:
    =Have you all display drivers loaded into your system? (The correct ones for your graphic card?)
    =Is your Graphic card recognized correctly in the "Device manager menu" without any "yellow conflict" signs?
    You will find the most (Toshiba supplied) recent Display drivers in the dedicated upgrade section for your model. Here is a tiny-link to the Toshiba Display driver for your model. Make sure to choose the correct chipset (nvidia OR INTEL).
    http://tinyurl.com/24gmry
    Regards,
    electrochain

  • Dll file to change monitor resolution to 1024*768

    hi,
    i want to change my  computer monitor resolution to 1024*768 programatically. If anybody have this .dll file please suggest me so that i can call this dll in labview apllication and will set my PC resolution to 1024*768 . Please do the needful.
    Regards
    Falgandha Mohire

    G Toolbox has a set of VIs can do this:
    Enumerate Display Mode: Enumerate all supported display modes(width, height, color depth, & frequency) on your computer;
    Get Display Mode: Get current screen resolution, color depth, and frequency;
    Restore Display Mode: Restore the screen resolution, color and frequency to the registry values dynamically;
    Set Display Mode: Change screen resolution, color and frequency dynamically, with option of change registry settings.  If no change, the previous settings can be restored with Restore Display Mode, or reboot.
    George Zou
    http://webspace.webring.com/people/og/gtoolbox

  • XGA 1024*768 with 60Hz

    I would use my old iBook for slideshows on tv. But my tv can only play 1024*768 with 60 hz (not 75 hz). How can i change the refresh-rate?

    How are you connecting the iBook to your TV?
    If your iBook has an analog or S-video output, go into System Preferences > Monitors.
    You should see that there is an "Arrange" tab. Click it and you will see two monitor icons.
    One is for the computer the other is for your TV. You can change the refresh rate on the TV icon's settings there. It is not possible, or neccessary to change the refresh rate on the computers LCD display.

  • Javascript:resizeTo(1024,768); no longer works

    After upgrading from version 3.6 to 14.0.1 I find that this javascript bookmark no longer works to resize the window.
    javascript:resizeTo(1024,768);
    Is this by design?
    Is there a work around?

    You can also do this with code in Error Console or via an extension or toolbar button that allows to run code with chrome privileges.
    *https://developer.mozilla.org/en/Error_Console
    <pre><nowiki>var Cc=Components.classes, Ci=Components.interfaces;
    var ps = Cc["@mozilla.org/embedcomp/prompt-service;1"].getService(Ci.nsIPromptService);
    var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
    var nb = wm.getMostRecentWindow("navigator:browser");
    var txt = 'width x height';
    var obj = new Object; obj.value = nb.window.outerWidth + 'x' + nb.window.outerHeight;
    if(ps.prompt(null, 'Resize Window', txt, obj, null, {}) && obj.value){
    var vA = obj.value.split("x");
    if(vA[0]) nb.window.outerWidth = vA[0];
    if(vA[1]) nb.window.outerHeight = vA[1];
    }</nowiki></pre>

  • Problem with latest patch, Mozilla won't fit on 1024*768

    Today (13/07/04) after the Mozilla patch, the display of the explorer is get bigger. I use 1024*768 on desktop. Now I have to scroll sideways to see the full page...
    Please fix it
    Thank You

    This is it, thank you, it's now good with 125% windows display with 1.0 value.
    Cheers

  • Seeking a CRT, 1024/768 Monitor...

    I have an aging 9 yr. old Sony Trinitron 17 inch which works great on my new MacMini; however the monitor needs to be replaced due to white dimming and contrast is slipping so letters are not as crisp. I have tried twice to get new monitors but they have distortion problems unable to give a true squared off display like the Sony. Yes, I used all the OSD settings to wrestle the monitor into shape, so to speak. But they also show inconsistent white color across the display.
    I am now in process of getting replacements from the Viewsonic and Lenovo. Hopefully they will work better. I really need a monitor that is accurate for color and shape and bright. I am tried of spending funds and returns. Please, I need to know why the Sony works right and the others wont. I am a legally blind guy (hence the low res) who enjoys doing graphic design so a correct monitor is important. I love my MacMini, now it just needs a good display. Help!

    The problem with LCD displays is that by the very nature of LCDs, they are, essentially, fixed resolution. That's why they each have a 'native' resolution at which they work best. Unlike a CRT where the screen is a continuous coating of phosphor, and each dot lit by a scanning beam making it possible to switch between all available resolutions with no incremental degradation of sharpness, LCDs screens are comprised of physical 'dots' (the LCDs themselves in fact). The number of LCDs dictates what the native resolution is - for example, a 15" panel has 1024 LCDs horizontally, and 768 vertically. 17 and 19 inch panels have 1280 horizontally by 1024 vertically.
    LCD displays can operate at lower resolution than their native settings, but in effect only by interpreting the signal, which along with the fact that then the edges of objects don't correspond to the exact edges of the LCDs themselves, gives the edges that fuzziness.
    Many people with significant visual disability are left with the choice of buying very large LCD screens in order to get a usable image or hunting for the few remaining CRT screens. Some of the LCD manufacturers, aware of these problems, have been working on improved displays which give sharper results below their native settings, (and LCDs have been steadily improving over the years in this respect too) but even the best are still relatively poor compared to the sharpness achievable with a good CRT.
    LCDs with DVI really are a significant improvement though, because DVI enables the system to communicate with the display without 'translating' the digital signal inside to the computer to analog signal for use by the display. That process of translating it causes degradation, which results in less contrast, lower brightness, softer color and less crispness. A DVI display will therefore look much better, because it is sharper/brighter to begin with and while it will still suffer fuzziness when set below the native resolution, will give much better results than an equivalent VGA device.
    Sadly though, it's LCD technology itself which is the cause of your problem, and it may well be, depending on the degree of impairment and your particular sensitivities, that a CRT will be the only real solution. I'd recommend you have a look at good display models such as the Dell Ultrasharp range before you give up on LCDs, though these may well be stretching your budget.
    As such, it might be a better solution, certainly for the short term, to find a used CRT with relatively little use, and which should be quite inexpensive, thus giving you time to look around for a good LCD, and for prices of high quality LCDs to drop a little more. I know that many companies have been throwing often very good quality CRT displays away over the last couple of years as they have upgraded to LCDs, so there's been no shortage of used ones around - often free if you know where to look!
    You don't say where you're located, but you might find there's a local center in your area offering specialized help and support for the disabled and which may be able to put you in touch with sources for such things. I'd start by contacting your town/city hall to see if they run such a place, or know of one. Alternatively, your doctor may know.

  • Screes Resolution 800*600 and 1024*768

    hi all
    i need trigger to solve Screes Resolution in run fmx !
    if developed the program under 800*600 res. ok run
    but when change the resolution some of items can't display>
    [email protected]
    bye

    Shadi Zaal,
    The screen resolution is a aspect of the Operating System. To change in dynamically is technically possible, but it is probably not worth the time and money to research how to do it. You will need to dig through Microsoft's website (assuming you are running on Windows) to find information on how to send changes to the display control panel applet. More than likely, all you will find is a way to open the applet, not directly change the resolution.
    I think a better option would be to establish a resolution standard and require your users to adopt this resolution as their default.
    Sorry I couldn't be more helpful.
    Craig...

  • Presentation Director allows only max 1024 x 768

    Hi,
    I have a T42 and recently purchased a 22" LCD monitor to connect through my dock station. When I dock my thinkpad I can only see in 1024*768 resolution and would like to configure it to 1280*1024. When I do it manually and undock the Thinkpad its LCD remains in 1280*1024 and to restore it to 1024*768 It asks to reboot windows.
    Can anyone help me?
    Thanks.
    Juan

    The Syncmaster 510 is a 15" LCD monitor and the highest resolution it supports is 1024 x 768. That is why you can't get it to go higher. You will need to upgrade to a larger monitor in order to have 1280 x 800 on the external monitor.

  • Unable to clear text Field in Multi Screen JFrame GUI Application

    i am working with a Swing GUI project where I want to accept user input in a
    text field
    I have used singleton pattern which will create only one instance of object
    due to this when i move from one scree to another the input of textfield
    doesnt updated I have used setText method to clear the JTextField but it wont
    works
    Program one -- 1st screen
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    import java.awt.event.*;
    import javax.swing.JTextField;
    public class Frame1 extends JFrame
    public static Frame1 frame1;
    public JButton button;
    public JTextField input;
    public static Frame1 getInstance()
    if(frame1==null)
    frame1 = new Frame1();
    return frame1;
    public JButton getJButton(String mytext)
    JButton button = new JButton();
    button.setText(mytext);
    button.setBounds(450,450,150,50);
    return button;
    public void myGUI()
    JPanel panel = new JPanel();
    panel.setLayout(null);
    button = getJButton("1st Frame");
    addActionListener(button);
    input = new JTextField(10);
    input.setBounds(200,300,100,30);
    panel.add(input);
    panel.add(button);
    add(panel);
    setUndecorated(true);
    setSize(1024, 768);
    setVisible(true);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    public void addActionListener(Object obj)
    try{
    JButton button1 = (JButton)obj;
    button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae)
    String text = "";
    input.insert("", 0);
    Frame2.getInstance().myGUI();
    Frame2.getInstance().repaint();
    dispose();
    catch(Exception e1)
    System.out.println("Exception==> "+e1.toString());
    public static void main(String[] args)
    Frame1.getInstance().myGUI();
    Frame1.getInstance().repaint();
    program 2 - 2nd screen
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    import java.awt.event.*;
    import javax.swing.JTextField;
    public class Frame2 extends JFrame
    static Frame2 frame2;
    public JButton BackButton;
    public JTextField input;
    public static Frame2 getInstance()
    if(frame2==null)
    frame2 = new Frame2();
    return frame2;
    public JButton getJButton(String mytext)
    JButton button = new JButton();
    button.setText(mytext);
    button.setBounds(450,450,150,50);
    return button;
    public void addActionListener(Object obj)
    try{
    JButton BackButton1 = (JButton)obj;
    BackButton.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent ae)
    input.setText("");
    Frame1.getInstance().myGUI();
    Frame1.getInstance().repaint();
    dispose();
    catch(Exception e2)
    System.out.println("Exception==> "+e2.toString());
    public void myGUI()
    JPanel panel2 = new JPanel();
    panel2.setLayout(null);
    BackButton = getJButton("2nd Screen");
    addActionListener(BackButton);
    input = new JTextField(10);
    input.setBounds(200,300,100,30);
    panel2.add(input);
    panel2.add(BackButton);
    add(panel2);
    setUndecorated(true);
    setSize(1024, 768);
    setVisible(true);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    In this application the status of TextField input remain same means it shows
    the earlier input in the textfield wnen I come to earlier or next screen.
    what is the solution to clear the TextField input while moving from 1st
    scrren to 2nd screen.

    multiple screens = multiple posts
    well done indeed - just another farking cross-poster
    [http://www.coderanch.com/t/492998/Swing-AWT-SWT-JFace/java/unable-clear-text-box-Multi#2218566]

  • What is equivalent of JInternalFrame in JavaFX 2.0?

    what is equivalent of JInternalFrame in JavaFX 2.0?
    Actually I want to use pure javaFX 2.0 to view report created in iReport 5.0.0.
    I have used java.swing code, and now I want to use pure javaFX 2.0.
    My code in swing is as follows
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package reports;
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.util.HashMap;
    import net.sf.jasperreports.engine.JRException;
    import net.sf.jasperreports.engine.JasperFillManager;
    import net.sf.jasperreports.engine.JasperPrint;
    import net.sf.jasperreports.view.JRViewer;
    * @author TANVIR AHMED
    public class ReportsViewer extends javax.swing.JInternalFrame {
    * Creates new form MyiReportViewer
    private ReportsViewer()
    super("Report Viewer",true,true,true,true);
    initComponents();
    setBounds(10,10,600,500);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    public ReportsViewer(String fileName)
    this(fileName,null);
    public ReportsViewer(String fileName,HashMap parameter)
    this();
    try
    /* load the required JDBC driver and create the connection
    here JDBC Type Four Driver for MySQL is used*/
    //Class.forName("com.mysql.jdbc.Driver");
    Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "invoice", "item");
    //Connection con=DriverManager.getConnection("jdbc:mysql://localhost/inventory","root","karim");
    /*(Here the parameter file should be in .jasper extension
    i.e., the compiled report)*/
    JasperPrint print = JasperFillManager.fillReport(
    fileName, parameter, con);
    JRViewer viewer=new JRViewer(print);
    Container c=getContentPane();
    c.setLayout(new BorderLayout());
    c.add(viewer);
    catch(SQLException sqle)
    sqle.printStackTrace();
    catch(JRException jre)
    jre.printStackTrace();
    * This method is called from within the constructor to initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is always
    * regenerated by the Form Editor.
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 394, Short.MAX_VALUE)
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGap(0, 290, Short.MAX_VALUE)
    pack();
    }// </editor-fold>
    // Variables declaration - do not modify
    // End of variables declaration
    and
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package reports;
    import java.beans.PropertyVetoException;
    * @author TANVIR AHMED
    public class MainUI extends javax.swing.JFrame {
    * Creates new form MainUI
    public MainUI() {
    super("REPORTS");
    initComponents();
    setSize(java.awt.Toolkit.getDefaultToolkit().getScreenSize());
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
    jMenuItem1 = new javax.swing.JMenuItem();
    desktopPane = new javax.swing.JDesktopPane();
    salesTaxInv = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    supplyRegister = new javax.swing.JButton();
    PartyLedger = new javax.swing.JButton();
    menuBar = new javax.swing.JMenuBar();
    jMenuItem1.setText("jMenuItem1");
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    desktopPane.setBackground(new java.awt.Color(255, 204, 0));
    desktopPane.setBorder(new javax.swing.border.MatteBorder(null));
    desktopPane.setForeground(new java.awt.Color(255, 0, 102));
    desktopPane.setAutoscrolls(true);
    desktopPane.setFont(new java.awt.Font("Bookman Old Style", 0, 14)); // NOI18N
    desktopPane.setPreferredSize(new java.awt.Dimension(1024, 768));
    salesTaxInv.setBackground(new java.awt.Color(255, 255, 255));
    salesTaxInv.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); // NOI18N
    salesTaxInv.setForeground(new java.awt.Color(204, 0, 0));
    salesTaxInv.setText("Sales Tax Invoice");
    salesTaxInv.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    salesTaxInvActionPerformed(evt);
    salesTaxInv.setBounds(20, 53, 200, 31);
    desktopPane.add(salesTaxInv, javax.swing.JLayeredPane.DEFAULT_LAYER);
    jLabel1.setFont(new java.awt.Font("Bookman Old Style", 0, 24)); // NOI18N
    jLabel1.setForeground(new java.awt.Color(50, 72, 255));
    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setText("Invoice System Reports");
    jLabel1.setBounds(0, -1, 1024, 50);
    desktopPane.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);
    supplyRegister.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); // NOI18N
    supplyRegister.setForeground(new java.awt.Color(204, 0, 0));
    supplyRegister.setText("Supply Register");
    supplyRegister.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    supplyRegisterActionPerformed(evt);
    supplyRegister.setBounds(20, 100, 200, 30);
    desktopPane.add(supplyRegister, javax.swing.JLayeredPane.DEFAULT_LAYER);
    PartyLedger.setFont(new java.awt.Font("Bookman Old Style", 1, 18)); // NOI18N
    PartyLedger.setForeground(new java.awt.Color(204, 0, 0));
    PartyLedger.setText("Party Ledger");
    PartyLedger.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    PartyLedgerActionPerformed(evt);
    PartyLedger.setBounds(20, 140, 200, 30);
    desktopPane.add(PartyLedger, javax.swing.JLayeredPane.DEFAULT_LAYER);
    setJMenuBar(menuBar);
    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(desktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    layout.setVerticalGroup(
    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addComponent(desktopPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    pack();
    }// </editor-fold>
    private void salesTaxInvActionPerformed(java.awt.event.ActionEvent evt) {                                           
    try
    ReportsViewer myiReportViewer = new ReportsViewer("reports/INV.jasper");
    myiReportViewer.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
    myiReportViewer.setVisible(true);
    desktopPane.add(myiReportViewer);
    myiReportViewer.setSelected(true);
    catch (PropertyVetoException pve)
    pve.printStackTrace();
    private void supplyRegisterActionPerformed(java.awt.event.ActionEvent evt) {                                              
    try
    ReportsViewer myiReportViewer = new ReportsViewer("reports/supplyRegister.jasper");
    myiReportViewer.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
    myiReportViewer.setVisible(true);
    desktopPane.add(myiReportViewer);
    myiReportViewer.setSelected(true);
    catch (PropertyVetoException pve)
    pve.printStackTrace();
    private void PartyLedgerActionPerformed(java.awt.event.ActionEvent evt) {                                           
    try
    ReportsViewer myiReportViewer = new ReportsViewer("reports/CustomerLedger.jasper");
    myiReportViewer.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight());
    myiReportViewer.setVisible(true);
    desktopPane.add(myiReportViewer);
    myiReportViewer.setSelected(true);
    catch (PropertyVetoException pve)
    pve.printStackTrace();
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new MainUI().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton PartyLedger;
    private javax.swing.JDesktopPane desktopPane;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JButton salesTaxInv;
    private javax.swing.JButton supplyRegister;
    // End of variables declaration
    Best Regards

    Dear Sir,
    I am using the swing code and running the jasper report with the above code.
    Realy!
    I start the thread with this code
    @FXML
    private void mainUiButtonAction(ActionEvent event) {
    try{
    new MainUI().setVisible(true);
    catch(Exception ex){                 
    }

  • Convert applet to swing

    Hi;
    Could anyone help me to convert my example code from applet to swing,please, thank
    import java.awt.*;
    import java.applet.*;
    import java.lang.Math;
    import java.awt.Font;
    import java.lang.Integer;
    /*** Main class == Applet  ***/
    public class Suffix extends Applet implements Runnable {
       private Thread main;
       public s_tree _tree=null;
       public node nd=null;
       public boolean userPause=false,resumed=false;
       private String str[]={"GOOGOL$","Paused","Resumed","Compacting","Done"};
       public Color bl=Color.blue,rd=Color.red;
       public Font fnt;
       public int mode=3,delay=3000;
       private char alph[]={'$','Q','W','E','R','T','Y','U','I','O',
                        'P','A','S','D','F','G','H','J','K','L',
                        'Z','X','C','V','B','N','M'};
    /*** initialisation function. It is the first Funct to be called ***/
       public void init() {
    // Temp data
          int temp=0,nxx=30;
    // Ini. of fnt , the font size + style used by this applet.
          fnt=new Font("Denis",1,25);
    /*** parsing command parameters ***/
    //      try {
    //DELAY VALUE PARAM
             String param=getParameter("DELAY");
             if (param!=null) {
                temp=Integer.parseInt(param);
                if ((temp>500)&&(temp<6000)) delay=temp;
    //x LEFTMOST coordinate
             param=getParameter("X");
             if (param!=null) {
                temp=Integer.parseInt(param);
                nxx=temp;
    //Base String parameter
             param=getParameter("STRING");
             if ((param!=null)&&(param.length()<15)) {
                str[0]=param;
    //      } catch (ParseException e) { showParseError(e); }
    // Allocating mem for _tree + initialize it .
          _tree=new s_tree(str[0],fnt);
    // Override xx (left_bound) by the caller's or the default value
          _tree.xx=nxx;
    /*** "animation loop is controled here" ***/
       public void run() {
         while(true) {
             try {
    //delay the process for time==delay
                Thread.sleep(delay);
             } catch (InterruptedException e) {}
    //controls animation loop
          repaint();
    /*** override APPLET's paint function ***/
       public void paint (Graphics g) {
    //Output graphics
          update(g);
    /*** Updates the graphics ***/
       public void update (Graphics g) {
    // Set font
          if (g.getFont()!=fnt) g.setFont(fnt);
          if ((userPause==false)&&(resumed==false)) // Is the applet paused ?
             g.clearRect(0,0,1024,768); //clears the screen
             if (_tree==null) {     // if tree is not initialised
                init();
                //_tree.show(g);
             } else {
                if (mode==3) {      // if graphics output mode is 3
                   if (nd!=null) nd._to_rd(false);
                   nd=_tree.step_compact(nd);  //compacts the tree one step further
                   if (nd==null)  // if tree is totally compacted ...
                      mode=4;   //change the ani. mode to 4 (don't call compact)
                   else
                      nd._to_rd(true);  //colors the next node to compact in red
    // Draw the "titleviewport's" comment
             g.setColor(bl);
             g.drawString(str[mode],10,15);
             _tree.show(g);     //show tree
          } else {
             g.clearRect(0,0,200,25);  //clears the "titleviewport to update it"
             g.setColor(rd);
             if (resumed==true){
                resumed=false;
                g.drawString(str[2],10,15);
             else g.drawString(str[1],10,15);
    /*** restart the animation process ***/
       public void start() {
          main=new Thread(this);
          main.start();
    /*** stops the animation ***/
       public void stop() {
          main.stop();
          main=null;
    /*** Handles the user's events (mouse , kbd , ... ***/
       public boolean handleEvent(Event evt) {
          if (evt.id==Event.MOUSE_DOWN) { //if mouse button have been pushed ...
                if (main!=null && main.isAlive()) {
                   if (userPause) {
                      main.start();
                      resumed=true;
                   } else {
                      main.stop();
                   userPause= !userPause;
                } else {
                   main= new Thread(this);
                   main.start();
                   userPause=false;
                   resumed=true;
                repaint();
             return true;
          } else {
             return super.handleEvent(evt);
    /*** Linked List of node(s) ***/
    class nodelist{
       nodelist next=null;
       node ptr=null;
       public void nodelist(){};
    /*** node of a structure tree ***/
    class node {
    // Relatives
       public nodelist children=null;
       public node parent=null;
    // variables
       public int maxchild=12,childnum=0,level=0;
       public int center[]={0,0};
       public int xlen=20,ylen=10,vspace=15,hspace=8;
       public int x[]={0,0};
       public boolean _ishidden=false;
       private Color bk=Color.black,wh=Color.white,rd=Color.red;
    // Node==red toggle variable
       public boolean to_rd=false;
    // node's text
       public String label=null;
    /*** initialisation of the node ***/
       public node(int nx,int ny,int nxl,int nyl,node nparent,int nlevel,String nstr){
          x[0]=nx; x[1]=ny;
          xlen=nxl; ylen=nyl;
          parent=nparent;
          level=nlevel;
          label=new String(nstr);
          children=new nodelist();
    /*** destroys the node ***/
       public void destruct() {
    // NOTE : not like C++ destructors . Do not confuse .
          delete_subtree();
          children=null;
          parent=null;
          bk=wh=rd=null;
          label=null;
    /*** Node to red toggle switch ***/
       public void _to_rd(boolean b) {to_rd=b;};
    /*** Adds a child to this node ***/
       public void add_child(int nx,int ny,int nxl,int nyl,node nparent,int nlevel,
                                String nstr) {
          if (childnum<maxchild) {    // if 'legal' space left ...
             if (children==null) {    // if no nodelist attached ...
                children=new nodelist(); //init. children
                children.ptr=new node(nx,ny,nxl,nyl,nparent,nlevel,nstr); //create node
                childnum++;
             } else {
                nodelist dummy=children;
    // search for the last nodelist
                while (dummy.next!=null) dummy=dummy.next;
                dummy.next=new nodelist(); //adds a nodelist
                dummy=dummy.next;
                dummy.ptr=new node(nx,ny,nxl,nyl,nparent,nlevel,nstr); //create child
                childnum++;
    // Tree needs to be realigned
    /*** adds a child and returns its address ***/
       public node add_child_ret(int nx,int ny,int nxl,int nyl,node nparent,int nlevel,
                                String nstr) {
          if (childnum<maxchild) {
             if (children==null) {
                children=new nodelist();
                children.ptr=new node(nx,ny,nxl,nyl,nparent,nlevel,nstr);
                childnum++;
                return(children.ptr);
             } else {
                nodelist dummy=children;
    // search for the last child
                while (dummy.next!=null) dummy=dummy.next;
                dummy.next=new nodelist();
                dummy=dummy.next;
                dummy.ptr=new node(nx,ny,nxl,nyl,nparent,nlevel,nstr);
                childnum++;
                return(dummy.ptr);
        return(null);
    // Tree needs to be realigned
    /*** adds the node nchild as a new children ***/
       public void add_child(node nchild) {
          nodelist dummy=null;
          dummy=children;
          if (childnum<maxchild) {
             if (children==null) {
                children=new nodelist();
                children.ptr=nchild;
                childnum++;
             } else {
                while (dummy.next!=null) dummy=dummy.next;
                dummy.next=new nodelist();
                dummy=dummy.next;
                dummy.ptr=nchild;
                childnum++;
    //Tree needs to restructured.
    /*** deletes all childrens ***/
       public void delete_subtree() {
          while (childnum>0 && children!=null) { //while child exists , kill it
             if (children.ptr!=null) {
                children.ptr.destruct();
                children.ptr=null;
                children=children.next;
             } else children=null;
             childnum--;
    /*** moves this node and its children horizontally ***/
       public void move_tree(int nx) {
          nodelist dummy=children;
          x[0]+=nx;
          while (childnum>0 && dummy!=null) {
             if (dummy.ptr!=null) {
                dummy.ptr.move_tree(nx);
                dummy=dummy.next;
    /*** removes the node from the tree (do not preserve order of ordered tree ) ***/
       public void remove_node() {
          nodelist dummy=children;
          while(dummy!=null) {
             if (dummy.ptr!=null){
                parent.add_child(dummy.ptr);
             dummy=dummy.next;
          children=null;
    //could call restructure tree here .
    //don't forget to change the node's levels !!!
    /*** show all nodes ***/
       public void show_all(Graphics g) {
          if (_ishidden==false) { //if not hidden
             if (children!=null) {  //if child exist
                nodelist dummy=children; //temp var.
                while(dummy!=null) { //while there is a child...
                   if (dummy.ptr!=null)
                      dummy.ptr.show_all(g);
                   dummy=dummy.next;
             show_node(g);
    /*** show nodes in preorder ***/
       public int preorder_show(Graphics g,int label){
          if (_ishidden==false) {
             show_node(g/*,label++*/);
             if (children!=null) {
                nodelist dummy=children;
                while(dummy!=null) {
                   if (dummy.ptr!=null) label=dummy.ptr.preorder_show(g,label);
                   dummy=dummy.next;
          return(label);
    /** show nodes in postorder ***/
       public int postorder_show(Graphics g,int label){
          if (_ishidden==false) {
             if (children!=null) {
                nodelist dummy=children;
                while(dummy!=null) {
                   if (dummy.ptr!=null) label=dummy.ptr.postorder_show(g,label);
                   dummy=dummy.next;
             show_node(g/*,label++*/);
          return(label);
    /*** show nodes in inorder ***/
       public int inorder_show(Graphics g,int label){
          if (_ishidden==false) {
             if (children!=null) {
                nodelist dummy=children;
                if (dummy.ptr!=null) label=dummy.ptr.inorder_show(g,label);
                dummy=dummy.next;
                show_node(g/*,label++*/);
                while(dummy!=null) {
                   if (dummy.ptr!=null) label=dummy.ptr.inorder_show(g,label);
                   dummy=dummy.next;
             } else show_node(g/*,label++*/);
          return(label);
    /*** Restructure the coordinates of all nodes ***/
       public int align(int min,Font fnt,int lev,Graphics g){
          int i=min; //left bound
          FontMetrics fntm=g.getFontMetrics(fnt); //used to know the text size
          level=lev;
    // node x and y radius are computed here
          xlen=4+(int)(fntm.stringWidth(label)/2);
          ylen=4+(int)(fntm.getHeight()/2);
          if (children!=null) {      //if child present ...
             nodelist dummy=children;
             while(dummy!=null) {
                if (dummy.ptr!=null) i=dummy.ptr.align(i,fnt,lev+1,g); //align them
                   dummy=dummy.next;
          x[0]=min+(int)((i-min)/2); //could be underflow so will be checked
          x[1]=lev*(vspace+(ylen*2))+26;
    // overflow should happen only when the parent node is larger than its children
          if ((x[0]-xlen)<min) { //check uf underflow occurs.
             move_tree(min+xlen-x[0]+1);
             i=x[0]+xlen+5;
          if (childnum==0) x[0]+=2;
        return(i);
    /*** returns the child following nd ***/
    /*** if nd==null -> return 1st child ***/
    /***  if nd==last children -> return null***/
       public node next_child(node nd) {
          nodelist dummy=null;
          if (children==null) return(null);
          if (nd==null) return(children.ptr);
          dummy=children;
          while (dummy.ptr!=nd) {
             if (dummy.next!=null)
                dummy=dummy.next;
             else
                return(null);
          dummy=dummy.next;
          if (dummy!=null) return(dummy.ptr);
             else return(null);
    /*** returns child with first letter==nh ***/
       public node get_childd(char ch) {
          nodelist dummy=null;
          dummy=children;
          while (dummy!=null) {
             if (dummy.ptr!=null) {
                if (dummy.ptr.label.charAt(0)==ch)
                   return(dummy.ptr);
             dummy=dummy.next;
        return(null);
    /*** returns the nodelist containing nd ***/
       public nodelist get_child(node nd) {
          nodelist dummy=children;
          while (dummy!=null) {
             if (dummy.ptr==nd) return(dummy);
             dummy=dummy.next;
        return(null);
    /*** outputs the node to Screen ***/
       public void show_node(Graphics g) {
          if (_ishidden==false) {
             if (level>0) {  //if it is not a root then draw link-line
                g.setColor(bk);
                g.drawLine(x[0],x[1]-ylen,parent.x[0],parent.x[1]+parent.ylen); //from this node to parent node
             if (to_rd==false)
                g.setColor(wh);
             else
                g.setColor(rd);
             g.fillOval(x[0]-xlen,x[1]-ylen,xlen*2,ylen*2); //draws an oval
             g.setColor(bk);
             g.drawString(label,x[0]-xlen+4,x[1]+ylen-12);  //output the text
    /*** class which uses nodes to create a SUFFIX TREE ***/
    class s_tree {
       node root=null;    // root node.
       String str=null;   // 'search' string
       Font fnt=null;     // font type
       int xx=30;         // left limit for graphics
    /*** initialize a SUFFIX TREE with string==nstr and Font==nfnt ***/
       public s_tree(String nstr,Font nfnt) {
          str=new String(nstr);
          fnt=nfnt;
          create();
    /*** uninitialize the structure **/
       public void destruct() {
          root.destruct();
          str=null;
          fnt=null;
    /*** show the tree ***/
       public void show(Graphics g) {
          root.align(xx,fnt,0,g);   // restructure node's coordinates
          root.show_all(g); //show tree
    /*** creates a tree structure from String=str ***/
       public void create() {
          node dummy=null;
          root=new node(0,0,0,0,dummy,0," "); //create root
          root.parent=null; //just to make sure ...
          for (int i=0;i<str.length();i++) {
    // Create subtree of root in the following way :
    //    create subtree ("ASDF$");
    //        "     "    ("aSDF$");
    //       "    "      ("asDF$"); ...
    // where : the UPPERCASE letters is the part of the string sent to insert_string
             insert_string(str.substring(i));
          //root.align(0,fnt,0); //align root now ?
    /*** creates a subtree of ROOT with String=nstr ***/
       public void insert_string(String nstr) {
          node dummy2=null,dummy=null;
          int i=0;
          dummy=root;
          dummy2=root;
    // As long as a children of dummy2 have the letter nstr[i] , dummy==thischildren
    // It is used to make sure that a node does not have two children with the
    // same letter
          while (dummy2!=null) {
             dummy2=dummy2.get_childd(nstr.charAt(i));
             if (dummy2!=null) {
                i++;
                dummy=dummy2;
    //create the nodes for the rest of the string
          for(;i<nstr.length();i++) {
             if (dummy!=null) dummy=dummy.add_child_ret(0,0,0,0,dummy,1,nstr.substring(i,i+1));
    // Compacts the tree node by node and returns the next node to compact
    // if node==null , compacts the first node ...
    //Works in POST-ORDER
       public node step_compact(node nd) {
          node dummy=nd,dummy2=null;
          nodelist ndlst=null;
    // GOES TO THE LOWER LEFT CHILDREN
          if (nd==null) { //first call !
             dummy=root;
             while(dummy.children!=null) {
                if (dummy.children.ptr==null)
                   dummy.children=dummy.children.next;
                else
                   dummy=dummy.children.ptr;
    //*** tries to find a 'compactable' node ***
    //*** It uses the POST-ORDER method      ***
    // if this node is not the last children then try to find next compactable node
    // in the next children.
          if (dummy.parent.childnum!=1) dummy=next_chain(dummy);
          if (dummy==null) return(null); //fully optimized
    //remove parent node.
    /*** THIS IS WHERE COMPACTING TAKES PLACE  **/
          dummy2=dummy.parent.parent;
          ndlst=dummy2.get_child(dummy.parent);
          if (ndlst==null) return(null); //we've got a beeeeg problem if this happens ...
    //*** merges the parent string with this one and delete parent .
          dummy.label=dummy.parent.label.concat(dummy.label);
          ndlst.ptr=dummy;
          //delete parent .
          dummy.parent=null;
          dummy.parent=dummy2;
    //      root.align(0,fnt,0);
        return(dummy);
    /*** finds the next chain in the tree (i.e. the next compactable node) ***/
       public node next_chain(node nd){
          node dummy=null;
          if (nd.parent==null) return(null); //finished ! This is the root
          if (nd.parent.childnum==1) return(nd); //can be optimized
    // finds the nd.parent's child following nd
          dummy=nd.parent.next_child(nd);
          if (dummy==null)  // if OLD_nd==last child
             return(next_chain(nd.parent));      //tries to find a chain upwards
          else {
                 // OLD_nd was not the last child . nd==OLD_nd's next brother
    // GOES TO THE LOWER LEFT most child of nd's subtree.
             while(dummy.children!=null) {
                if (dummy.children.ptr==null)
                   dummy.children=dummy.children.next;
                else
                   dummy=dummy.children.ptr;
             return(next_chain(dummy)); // returns the next compactable node
    };

    First, show me the rupees! Show me the rupees!

  • Create a new Buffered Image using Raster and ColorModel

    Sorry , I crosspost this message,because no one reply.
    Recently,I write a programme combining C++ and Java .
    The C++ part create a array containing image data in form of BI_RGB and biBitCount==32.
    The java part create a image using Raster and ColorModel like this:
       static int[] data ;
       DataBuffer db = new DataBufferInt(data, data.length);
       WritableRaster wr =Raster.createPackedRaster(db, 1024,768, 32, null);
       ColorModel cm = new DirectColorModel(32,0xff0000,0x00ff00,0x0000ff);
       img = new BufferedImage(cm, wr, false, null);But it doesn't work .
    it report this:
    Exception in thread "main" java.lang.IllegalArgumentException: Raster sun.awt.im
    age.SunWritableRaster@dff3a2 is incompatible with ColorModel DirectColorModel: r
    mask=ff0000 gmask=ff00 bmask=ff amask=0
    at java.awt.image.BufferedImage.<init>(BufferedImage.java:549)
    at monitor.test.Perform2.main(Perform2.java:39)

    hey epico
    compiles & runs 4 me
    see javadocs for SinglePixelPackedSampleModel
    import java.awt.image.*;
    public class Tester {
    DataBuffer db;
    WritableRaster wr;
    ColorModel cm;
    BufferedImage im;
    int[] data;
    int[] masks;
    int w = 768;
    int h = 576;
      public Tester() {
        data = new int[768*576];
        for (int i = 0;i < w*h ;i++ ) {
          data[i] = 0;
        masks = new int[3];
        masks[0] = 0xff0000;
        masks[1] = 0x00ff00;
        masks[2] = 0x0000ff;
        db = new DataBufferInt(data,data.length);
        SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT,w,h,masks);
        cm = new DirectColorModel(32,0xff0000,0x00ff00,0x0000ff);
        wr = Raster.createWritableRaster(sm,db,null);
        im = new BufferedImage(cm,wr,false,null);
      public static void main(String[] args) {
        Tester tester1 = new Tester();
    }

  • Now its not recreating a window

    In my Jdesktop i have one internatframe and when I press evaluate it should display a new window or frame, why is this not working
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.Color;
    import java.awt.Graphics;
    class GUI
         private static JTextField field1;
         private static JLabel statusLabel; // Label for status/result info
    private static JLabel outputinfix;
    private static JLabel minimumValue;
    private static JLabel outputpostfix;
    private static JLabel outputsolver;
    private static String result="";
         private static JInternalFrame fr2;
         private static JDesktopPane desktop;
         private static JFrame f;
         public static void main(String[] args)
         JFrame f = new JFrame("");
              ActionHandler action = new ActionHandler();
              /*Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              screenSize.width -=42;
              screenSize.height -= 42;*/
              f.setSize(1024,768);
              f.setLocation(20,20);
              f.setVisible(true);
         desktop = new JDesktopPane();
              desktop.setPreferredSize(new Dimension(1024, 768));
              desktop.setBackground(new Color(148,102,75));
              desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
              f.setContentPane(desktop);
              final JInternalFrame fr = new JInternalFrame("infix", false, true, true, true);
              fr.setSize(203, 126);
              fr.setLocation(50, 50);
              fr.setVisible(true);
              fr.setOpaque(false);
              fr.setBackground(new Color(100,0,255,140));
         JPanel panel = new JPanel();
              panel.setLayout(new BorderLayout());
         //panel.setLayout(new BorderLayout(0,0));
              panel.setSize(203,126);
              panel.setBackground(new Color(0,0,255,140));
              panel.setOpaque(false);
              JTextField field1 = new JTextField("",60);
              field1.setPreferredSize(new Dimension(200, 21));
              panel.add(field1,BorderLayout.NORTH);
              JButton evaluate = new JButton("Evaluate");
              evaluate.addActionListener(action);
              evaluate.setPreferredSize(new Dimension(101,25));
              panel.add(evaluate,BorderLayout.CENTER);
              JButton clear = new JButton("Clear");
              clear.addActionListener(action);
              clear.setPreferredSize(new Dimension(101,25));
              panel.add(clear,BorderLayout.EAST);
         JLabel label = new JLabel("");
              label.setPreferredSize(new Dimension(34,50));
              panel.add(label,BorderLayout.SOUTH);
              fr.add(panel);     
              desktop.add(fr);
              JInternalFrame fr2 = new JInternalFrame("test", true, true, true,false);
              fr2.setSize(230, 300);
              fr2.setLocation(50, 50);
              fr2.setVisible(true);
              fr2.setOpaque(false);
              fr2.setBackground(new Color(0,0,255,140));
         JPanel panel2 = new JPanel();
         panel2.setLayout(new BorderLayout(0, 0));
              fr2.add(panel2);
              desktop.add(fr2);*/
                        f.add(desktop);
         private static class ActionHandler implements ActionListener
              public void actionPerformed(ActionEvent event)
                   if(event.getActionCommand().equals("Evaluate"))
                   Infixtopost theTrans = new Infixtopost(field1.getText());
                   result= theTrans.Trans();
                   outputpostfix.setText(result);
                   outputinfix.setText(field1.getText());
                   JInternalFrame fr2 = new JInternalFrame("test", true, true, true,false);
              fr2.setSize(230, 300);
              fr2.setLocation(50, 50);
              fr2.setVisible(true);
         fr2.setOpaque(false);
              fr2.setBackground(new Color(0,0,255,140));
         JPanel panel2 = new JPanel();
         panel2.setLayout(new BorderLayout(0, 0));
              fr2.add(panel2);
              desktop.add(fr2);
              f.add(desktop);
                   else if(event.getActionCommand().equals("Clear"))
                        System.out.println("this is a test2");
         }

    when I try that I get this
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    here is so new code
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.Color;
    import java.awt.Graphics;
    class GUI
         private static JTextField field1;
         private static JLabel statusLabel; // Label for status/result info
    private static JLabel outputinfix;
    private static JLabel minimumValue;
    private static JLabel outputpostfix;
    private static JLabel outputsolver;
    private static String result="";
         private static JInternalFrame fr2;
         private static JDesktopPane desktop;
         private static JFrame f;
         public static void main(String[] args)
         JFrame f = new JFrame("");
              ActionHandler action = new ActionHandler();
              /*Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
              screenSize.width -=42;
              screenSize.height -= 42;*/
              f.setSize(1024,768);
              f.setLocation(20,20);
              f.setVisible(true);
         desktop = new JDesktopPane();
              desktop.setPreferredSize(new Dimension(1024, 768));
              int backcolor = (int)(Math.random()*100);
              desktop.setBackground(new Color(backcolor,backcolor,backcolor+78));
              desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
              f.setContentPane(desktop);
              final JInternalFrame fr = new JInternalFrame("infix", true, false, true, true);
              fr.setSize(203, 126);
              fr.setLocation(50, 50);
              fr.setVisible(true);
              fr.setOpaque(false);
              fr.setBackground(new Color(100,0,255,140));
         JPanel panel = new JPanel();
              panel.setLayout(new BorderLayout());
         //panel.setLayout(new BorderLayout(0,0));
              panel.setSize(203,126);
              panel.setBackground(new Color(0,0,255,140));
              panel.setOpaque(false);
              JTextField field1 = new JTextField("",60);
              field1.setPreferredSize(new Dimension(200, 21));
              panel.add(field1,BorderLayout.NORTH);
              JButton evaluate = new JButton("Evaluate");
              evaluate.addActionListener(action);
              evaluate.setPreferredSize(new Dimension(101,25));
              panel.add(evaluate,BorderLayout.CENTER);
              JButton clear = new JButton("Clear");
              clear.addActionListener(action);
              clear.setPreferredSize(new Dimension(101,25));
              panel.add(clear,BorderLayout.EAST);
         JLabel label = new JLabel("");
              label.setPreferredSize(new Dimension(34,50));
              panel.add(label,BorderLayout.SOUTH);
              fr.add(panel);     
              desktop.add(fr);
              f.add(desktop);
         private static class ActionHandler implements ActionListener
              public void actionPerformed(ActionEvent event)
                   if(event.getActionCommand().equals("Evaluate"))
              //     Infixtopost theTrans = new Infixtopost(field1.getText());
                   //result= theTrans.Trans();
                   //outputpostfix.setText(result);
                   //outputinfix.setText(field1.getText());
                   result = field1.getText();
                   System.out.println(result);
                        int r = (int)(Math.random()*300);
                        int g = (int)(Math.random()*300);
                        int b = (int)(Math.random()*300);
                        int p = (int)(Math.random()*700);
                        int p2 =(int)(Math.random()*700);
                        JInternalFrame fr2 = new JInternalFrame("test", true, true, true,true);
                        fr2.setSize(203, 126);
                        fr2.setLocation(p ,p2);
                        fr2.setVisible(true);
                        fr2.setOpaque(false);
                        fr2.setBackground(new Color(r,g,b,140));
                   JPanel panel2 = new JPanel();
                   panel2.setLayout(new BorderLayout(0, 0));
                        panel2.setSize(203,126);
                        panel2.setBackground(new Color(r,g,b,140));
                        panel2.setOpaque(false);
                        fr2.add(panel2);
                        desktop.add(fr2);
                        f.add(desktop);
                   else if(event.getActionCommand().equals("Clear"))
                   fr2.invalidate();
                        System.out.println("this is a test2");
    now if I comment out the result=field.getText(); then I can recreate windows,

Maybe you are looking for