I want to  implement the Window autoresize in java swing application

Hai...
i want implement the window autoresize functionality in my java application. Same time i want to minimize and maximize my won window. and my java application develop one more frame at time disply in single window so i want disply the thaminal view formate in all frame
Thanx to Advance.
ARjun...

????????

Similar Messages

  • How to create the digital clock in java swing application ?

    I want to create the running digital clock in my java swing application. Can someone throw some light on this how to do this ? Or If someone has done it then can someone pl. paste the code ?
    Thanks.

    hi prah_Rich,
    I have created a digital clock you can use. You will most likely have to change some things to use it in another app although that shouldn't be too hard. A least it can give you some ideas on how to create one of your own. There are three classes.One that creates the numbers. a gui class and frame class.
    cheers:)
    Hex45
    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.geom.*;
    public class DigitalClock extends Panel{
              BasicStroke stroke = new BasicStroke(4,BasicStroke.CAP_ROUND,
                                               BasicStroke.JOIN_BEVEL);
              String hour1, hour2;
              String minute1, minute2;
              String second1, second2;
              String mill1, mill2, mill3;
              int hr1, hr2;
              int min1, min2;
              int sec1, sec2;
              int mll1, mll2,mll3;       
        public void update(Graphics g){
             paint(g);
         public void paint(Graphics g){
              Graphics2D g2D = (Graphics2D)g;
              DigitalNumber num = new DigitalNumber(10,10,20,Color.cyan,Color.black);     
              GregorianCalendar c = new GregorianCalendar();
              String hour = String.valueOf(c.get(Calendar.HOUR));
              String minute = String.valueOf(c.get(Calendar.MINUTE));
              String second = String.valueOf(c.get(Calendar.SECOND));
              String milliSecond = String.valueOf(c.get(Calendar.MILLISECOND));
              if(hour.length()==2){
                   hour1 = hour.substring(0,1);
                   hour2 = hour.substring(1,2);
              }else{
                   hour1 = "0";
                   hour2 = hour.substring(0,1);
              if(minute.length()==2){
                   minute1 = minute.substring(0,1);
                   minute2 = minute.substring(1,2);
              }else{
                   minute1 = "0";
                   minute2 = minute.substring(0,1);
              if(second.length()==2){
                   second1 = second.substring(0,1);
                   second2 = second.substring(1,2);
              }else{
                   second1 = "0";
                   second2 = second.substring(0,1);
              if(milliSecond.length()==3){
                   mill1 = milliSecond.substring(0,1);
                   mill2 = milliSecond.substring(1,2);
                   mill3 = milliSecond.substring(2,3);
              }else if(milliSecond.length()==2){
                   mill1 = "0";
                   mill2 = milliSecond.substring(0,1);
                   mill3 = milliSecond.substring(1,2);
              }else{
                   mill1 = "0";
                   mill2 = "0";
                   mill3 = milliSecond.substring(0,1);
              hr1  = Integer.parseInt(hour1);     
              hr2  = Integer.parseInt(hour2);
              min1 = Integer.parseInt(minute1);
              min2 = Integer.parseInt(minute2);
              sec1 = Integer.parseInt(second1);
              sec2 = Integer.parseInt(second2);
              mll1 = Integer.parseInt(mill1);
              mll2 = Integer.parseInt(mill2);
              g2D.setStroke(stroke);
              g2D.setPaint(Color.cyan);
              num.setSpacing(true,8);
              num.setSpacing(true,8);
              if(hr1==0&hr2==0){
                   num.drawNumber(1,g2D);
                   num.setLocation(40,10);
                   num.drawNumber(2,g2D);
              else{
                   if(!(hr1 == 0)){     
                        num.drawNumber(hr1,g2D);
                   num.setLocation(40,10);
                   num.drawNumber(hr2,g2D);
              num.setLocation(70,10);
              num.drawNumber(DigitalNumber.DOTS,g2D);
              num.setLocation(100,10);
              num.drawNumber(min1,g2D);
              num.setLocation(130,10);
              num.drawNumber(min2,g2D);
              num.setLocation(160,10);
              num.drawNumber(DigitalNumber.DOTS,g2D);
              num.setLocation(190,10);
              num.drawNumber(sec1,g2D);
              num.setLocation(220,10);
              num.drawNumber(sec2,g2D);
              /*num.setLocation(250,10);
              num.drawNumber(DigitalNumber.DOTS,g2D);
              num.setLocation(280,10);
              num.drawNumber(mll1,g2D);
              num.setLocation(310,10);
              num.drawNumber(mll2,g2D);
              g2D.setPaint(Color.cyan);
              if((c.get(Calendar.AM_PM))==Calendar.AM){               
                   g2D.drawString("AM",260,20);
              }else{
                   g2D.drawString("PM",260,20);
         String dayOfweek = "";     
         switch(c.get(Calendar.DAY_OF_WEEK)){
              case(Calendar.SUNDAY):
                   dayOfweek = "Sunday, ";
                   break;
              case(Calendar.MONDAY):
                   dayOfweek = "Monday, ";
                   break;
              case(Calendar.TUESDAY):
                   dayOfweek = "Tuesday, ";
                   break;
              case(Calendar.WEDNESDAY):
                   dayOfweek = "Wednesday, ";
                   break;
              case(Calendar.THURSDAY):
                   dayOfweek = "Thursday, ";
                   break;
              case(Calendar.FRIDAY):
                   dayOfweek = "Friday, ";
                   break;
              case(Calendar.SATURDAY):
                   dayOfweek = "Saturday, ";
                   break;
         String month = "";     
         switch(c.get(Calendar.MONTH)){
              case(Calendar.JANUARY):
                   month = "January ";
                   break;
              case(Calendar.FEBRUARY):
                   month = "February ";
                   break;
              case(Calendar.MARCH):
                   month = "March ";
                   break;
              case(Calendar.APRIL):
                   month = "April ";
                   break;
              case(Calendar.MAY):
                   month = "May ";
                   break;
              case(Calendar.JUNE):
                   month = "June ";
                   break;
              case(Calendar.JULY):
                   month = "July ";
                   break;
              case(Calendar.AUGUST):
                   month = "August ";
                   break;
              case(Calendar.SEPTEMBER):
                   month = "September ";
                   break;
              case(Calendar.OCTOBER):
                   month = "October ";
                   break;
              case(Calendar.NOVEMBER):
                   month = "November ";
                   break;
              case(Calendar.DECEMBER):
                   month = "December ";
                   break;
         int day = c.get(Calendar.DAY_OF_MONTH);
         int year = c.get(Calendar.YEAR);
         Font font = new Font("serif",Font.PLAIN,24);
         g2D.setFont(font);
         g2D.drawString(dayOfweek+month+day+", "+year,10,80);
         public static void main(String args[]){
              AppFrame aframe = new AppFrame("Digital Clock");
              Container cpane = aframe.getContentPane();
              final DigitalClock dc = new DigitalClock();
              dc.setBackground(Color.black);
              cpane.add(dc,BorderLayout.CENTER);
              aframe.setSize(310,120);
              aframe.setVisible(true);
              class Task extends TimerTask {
                 public void run() {
                      dc.repaint();
              java.util.Timer timer = new java.util.Timer();
             timer.schedule(new Task(),0L,250L);
    class DigitalNumber {
         private float x=0;
         private float y=0;
         private float size=5;
         private int number;
         private Shape s;
         private float space = 0;
         public static final int DOTS = 10;
         private Color on,off;
         DigitalNumber(){          
              this(0f,0f,5f,Color.cyan,Color.black);          
         DigitalNumber(float x,float y, float size,Color on,Color off){
              this.x = x;
              this.y = y;
              this.size = size;
              this.on = on;
              this.off = off;
         public void drawNumber(int number,Graphics2D g){
              int flag = 0;
              switch(number){
                   case(0):          
                        flag = 125;
                        break;
                   case(1):
                        flag = 96;
                        break;
                   case(2):
                        flag = 55;
                        break;
                   case(3):
                        flag = 103;
                        break;
                   case(4):
                        flag = 106;
                        break;
                   case(5):
                        flag = 79;
                        break;
                   case(6):
                        flag = 94;
                        break;
                   case(7):
                        flag = 97;
                        break;
                   case(8):
                        flag = 127;
                        break;
                   case(9):
                        flag = 107;
                        break;
                   case(DOTS):
                        GeneralPath path = new GeneralPath();
                        path.moveTo(x+(size/2),y+(size/2)-1);
                        path.lineTo(x+(size/2),y+(size/2)+1);
                        path.moveTo(x+(size/2),y+(size/2)+size-1);
                        path.lineTo(x+(size/2),y+(size/2)+size+1);
                        g.setPaint(on);
                        g.draw(path);     
                        return;
              //Top          
              if((flag & 1) == 1){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath Top = new GeneralPath();
              Top.moveTo(x + space, y);
              Top.lineTo(x + size - space, y);
              g.draw(Top);
              //Middle
              if((flag & 2) == 2){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath Middle = new GeneralPath();
              Middle.moveTo(x + space, y + size); 
              Middle.lineTo(x + size - space,y + size);     
              g.draw(Middle);
              //Bottom
              if((flag & 4) == 4){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath Bottom = new GeneralPath();
              Bottom.moveTo(x + space, y + (size * 2));  
              Bottom.lineTo(x + size - space, y + (size * 2));
              g.draw(Bottom);
              //TopLeft
              if((flag & 8) == 8){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath TopLeft = new GeneralPath();     
              TopLeft.moveTo(x, y + space);
              TopLeft.lineTo(x, y + size - space);          
              g.draw(TopLeft);
              //BottomLeft
              if((flag & 16) == 16){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath BottomLeft = new GeneralPath();     
              BottomLeft.moveTo(x, y + size + space);
              BottomLeft.lineTo(x, y + (size * 2) - space);
              g.draw(BottomLeft);
              //TopRight
              if((flag & 32) == 32){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath TopRight = new GeneralPath();     
              TopRight.moveTo(x + size, y + space);
              TopRight.lineTo(x + size, y + size - space);
              g.draw(TopRight);
              //BottomRight
              if((flag & 64) == 64){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath BottomRight = new GeneralPath();     
              BottomRight.moveTo(x + size, y + size + space);
              BottomRight.lineTo(x + size, y + (size * 2) - space);
              g.draw(BottomRight);
         public void setSpacing(boolean spacingOn){
              if(spacingOn == false){
                   space = 0;
              else{
                   this.setSpacing(spacingOn,5f);
         public void setSpacing(boolean spacingOn,float gap){
              if(gap<2){
                   gap = 2;
              if(spacingOn == true){
                   space = size/gap;
         public void setLocation(float x,float y){
              this.x = x;
              this.y = y;
         public void setSize(float size){
              this.size = size;
    class AppFrame extends JFrame{
         AppFrame(){
              this("Demo Frame");
         AppFrame(String title){
              super(title);
              setSize(500,500);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

  • It says that i forces quit last time and askes if i want to reopen the window, then i click reopen and then it gives me the spinning ball

    it says that i forced quit last time, and askes if i want to reopen the window, then i click reopen and then it gives me the spinning ball. Then i have to force quit again.

    Can you give us more info about this?
    Name of the application?
    What happens if you restart the computer?

  • Disable prompt for "This Website wants to install the following Add-on: Java on Windows 7 x64 SP1 IE 10

    Sorry if this is the wrong place to post this-Didnt see any forum or I missed it for Internet Explorer.
    Here is my problem,  We have uses that are running a webpage that is trying to install an older version of Java, The workstation has the latest version of Java, BUT the webpage seems not to care, and wants to put a older version.
    Is there a way I can disable this:
    "This website wants to install the following add-on: 'Java SE Runtime Environment.....'.
    We have uses that will click on the Install button, and thus compromising the workstation.
    Thanks.

    Hi usgrcm,
    This is a security feature if IE and is not tied to whether or not you have a sight “allowed” to use an add-on.  It behaves in this manor to help protect you against malware. Disabling this notification is not a good choice .
    Have you tried to reinstall the Java software to have a check ?
    There is a possibility the present installation has corrupted .Please restart the machine after reinstalling the software.
    "BUT the webpage seems not to care, and wants to put a older version."
    We can try to install the old version to have a check.
    Best regards
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Accelarate the Linux ATI Graphics card  for java Swing application

    Hi All,
    I am using a ATI Radeon 9550 Graphic card in LFS (Linux from the scratch) environment. I want to enable the OpenGL-based pipeline for Java Swing application. I tried the -Dsun.java2d.opengl=true . But the Java swing application getting very slow.
    How to overcome this problem?
    Any one give the procedure to Accelerate ATI graphics card for Java Swing Application
    How to verify Java swing use ATI graphics card ?
    Thanks in advance..
    Prabhu.S

    Hi All,
    I am using a ATI Radeon 9550 Graphic card in LFS (Linux from the scratch) environment. I want to enable the OpenGL-based pipeline for Java Swing application. I tried the -Dsun.java2d.opengl=true . But the Java swing application getting very slow.
    How to overcome this problem?
    Any one give the procedure to Accelerate ATI graphics card for Java Swing Application
    How to verify Java swing use ATI graphics card ?
    Thanks in advance..
    Prabhu.S

  • Firefox doesn't open and even when i want uninstall it the window comes that close the firefox if it open but it doesn't open actually

    my mozilla firefox doesn't work when i want to open it , window comes that is user account something say do you want to allow and if i want to uninstall the firefox it doesn't uninstall.

    Make sure that you do not use [[Clear Recent History]] to clear the 'Browsing History' (Navigatiegeschiedenis) when you close Firefox.
    * [[Firefox does not ask to save tabs and windows on exit]]

  • I want ti implement the following

    Hi everybody,
    I have to implement the following idea and I dont know how. Any help will be apprciated.
    The idea is to scan an array for zeros, one a sequence of zeros is found then find its center and save in another array ?
    The folloaing image illustrate the idea
    http://nomatterwhat.jeeran.com/idea.JPG

    Thanks jos. I did the following modifications and it works now but I don't know if this is the end of the problems and also I'm not convinced by the initialization of zeroscenter[] since I initialize it by
    Int zeroscenter[]  = new int [100] ;here is the new version of the code:
    for (int i = 0; i < oneDim.length; i++) {
                if (array1[i] == 0) {
                    mark1 = mark2 = i;
                    i++;
                    if (i >= oneDim.length){
                        zeroscenter[j] = mark1;
                    else
                        while (array1[i] == 0)
                          mark2++;
            i++;
                    zeroscenter[j] = (mark1 + mark2) / 2;
                   j++;
    }

  • I want to enter into the chatting session and want to install the flash player and java, how can I do that?

    I want to see the images from the Internet, want to chat on dardesha, an Arabic chat site, want to dOwnload also java. If all these cannot be happened so then what is the use of Purchasing such a costly iPad, I am working on a shop where I use to sell my own laptops and accessories And was encouraging to purchase iPad, iPhones, apple laps etc but this problem is not going from the past several months if it will be like this then I will Throw this iPad and never buy or ask my customers to buy it. In this context I have gone through some of the discussions and Community answers but unable to find a solution for it.

    I swore I would never reply to another complaint on Flash, but your post really,really irked me.
    So, here I am and here's the facts.
    No Apple iOS mobile has ever and, probably, never will have Flash. Adobe has not developed a working reliable and stable version of Flash that Apple is willing to use on their devices.
    I looks like you didn't do any homework researching Apple mobile devices.
    These issues have been discussed over and over here in these forums and other places on the Internet.
    It's common knowledge that Adobe Flash has never been implemented on any of Apple's mobile platform devices.
    No secret here.
    See this article from Steve Jobs, himself.
    http://www.apple.com/hotnews/thoughts-on-flash/
    And, I believe Java does not work on iOS, either.
    Go ahead. Throw your iPad away.
    Other Tablet devices such as Motorola Xoom, Samsung's Galaxy Tab and Research in Motion's Playbook all do Flash and maybe Java, too!
    iPad is not for you! If you can find and purchase these in your location, you may fare better with one of these tablet devices, instead.  But I doubt it!
    Good Luck and Happy mobile computing! ;)
    Good luck!

  • The window of a java applet is not displayed by Netscape7.1.

    I am using Netscape7.1.
    A parent window is only what opens a new window.
    Please see index.html.
    --------index.html--------
    <HTML>
    <HEAD><TITLE>OYA</TITLE></HEAD>
    <BODY>
    <FORM>
    <CENTER><BR><BR><BR><BR><BR><BR><BR><BR>
    <input type="button" onClick="WIN=open('KODOMO.html', 'win_new_comp', ''); WIN.focus();" value="Open the Window">
    </FORM>
    </CENTER>
    </BODY>
    </HTML>
    There is a button of "CLOSE" with the Java applet called "SimplaApplet.class" in the window opened newly.
    Please see KODOMO.html and SimplaApplet.java.
    --------KODOMO.html--------
    <html>
    <title>Using Applet</title>
    <body>
    <FORM>
    <CENTER><BR><BR><BR>
    <!-- for IE -->
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"width="100" height="50">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
    <PARAM NAME="java_CODE" VALUE="SimpleApplet">
    <COMMENT>
    <!-- for Netscape-->
    <EMBED type="application/x-java-applet;version=1.4"
    width="100" height="50"
    code="SimpleApplet">
    </EMBED>
    </COMMENT>
    </OBJECT><BR><BR><BR><BR><BR><BR>
    <INPUT TYPE="button" VALUE="CLOSE" onClick="window.close()">
    </CENTER>
    </FORM>
    </BODY>
    </HTML>
    --------SimpleApplet.java--------
    import java.awt.*;
    import java.applet.*;
    public class SimpleApplet extends Applet {
    public void paint (Graphics g) {
    g.drawString("Simple Applet", 10, 30);
    The following operations are performed at this time.
    Step1: "Open the Window" is clicked by index.html.
    Step2: "CLOSE" is clicked by KODOMO.html.
    Step3: "Open the Window" is again clicked by index.html.
    Then, in second KODOMO.html, a Java applet and a "CLOSE" button are never displayed.
    If the same thing is performed by IE6.0 or Netscape4.75, this bug will not happen.
    Please let me know what is bad and whether there is any evasion measure.

    It forgot to write.
    The version of JavaPlug-IN is 1.4.2_03.
    OS is the Windows2000 Japanese version.
    Please access confirming this bug at the following HTML.
    http://web-p.wics.ne.jp/char_audi/index.html

  • How to implement the security notes in Java System.

    Hi All,
    For the ABAP systems we use RSECNOTE to implement the security notes, but how do we do that in Java systems?
    Any reference or guidance will be of great help.
    Thanks,
    Akash.

    RSECNOTE is for ABAP only, and I dont think there is any equivalent for Java.
    For Java , security note will guide you on how to implement.
    It could be manual changes or via SDM or JSPM.
    Regards,
    Pinkle

  • Closing the window - web dynpro Java

    Hi all,
    Do you know how to close the window when the user clicks on a button in web dynpro java?
    Thanks for your answers.
    Karim

    Hi,
    Declare two methods in ComponentContrroller
    like openWindow() and closeWindow()
    And in openWindow method write
    String winName=<anotherWindowName>;
    objWindow =
    wdComponentAPI.getWindowManager().createModalWindow(
    wdComponentAPI.getComponentInfo().findInWindows(strWindowName));
    objWindow.setWindowSize(150,200);
    objWindow.open();   
    Declare objWindow of type IWDWindow between
    //@@begin others
    //@@end
    In closeWindow() method write
    if(objWindow!=null)
       objWindow.destroy();
       objWindow=null;
    On your button click just call these methods to open and close external windows like
    wdThis.wdget<CompController>().closeWindow();
    Regards
    LN

  • Resizing the window in Telnet Java Plugin

    Hello all,
    Not sure if this was posted here before but can we resize the Java plugin window size used in clientless SSL VPN?
    Looking at getting the window bigger/larger.
    If so, how would you accomplish that?
    ASA code is 8.4.4 and SSH/Telnet plugin is ssh-plugin.120911.jar.
    Thanks in advance.
    Paul

    Hi Javier,
    No luck with adding the width and height parameters.
    here is the url in the bookmark...  telnet://10.0.0.100:2004/?width=800&height=800
    Tried with 300x300, 400x400, 600x600 and 800x800 and all have the same window size.
    Tried Internet Explorer and Firefox with the same results.
    Am I missing something?
    Thanks again!
    Paul

  • Java Swing application problem in Windows vista

    When we execute the Swing application in windows vista environment.
    The look and feel of the swing components are displayed improperly.
    Do we need to put any specific look and feel for windows vista environment or any specific hardware configuration is required to setup windows vista environment.
    Please give some inputs to solve the problem.
    We have tried with the following sample code to run in windows vista.
    * Vista.java
    * Created on December 5, 2006, 5:39 PM
    public class Vista extends javax.swing.JFrame {
    /** Creates new form Vista */
    public Vista() {
    initComponents();
    pack();
    /** 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.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
    jButton1 = new javax.swing.JButton();
    jToggleButton1 = new javax.swing.JToggleButton();
    jPanel1 = new javax.swing.JPanel();
    jCheckBox1 = new javax.swing.JCheckBox();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    jTextField1 = new javax.swing.JTextField();
    getContentPane().setLayout(null);
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    jButton1.setText("Button 1");
    getContentPane().add(jButton1);
    jButton1.setBounds(20, 20, 170, 30);
    jToggleButton1.setText("Togle btn");
    getContentPane().add(jToggleButton1);
    jToggleButton1.setBounds(100, 80, 90, 20);
    jPanel1.setLayout(null);
    jCheckBox1.setText("jCheckBox1");
    jCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0));
    jPanel1.add(jCheckBox1);
    jCheckBox1.setBounds(10, 40, 130, 13);
    getContentPane().add(jPanel1);
    jPanel1.setBounds(10, 150, 200, 130);
    jTextArea1.setColumns(20);
    jTextArea1.setRows(5);
    jScrollPane1.setViewportView(jTextArea1);
    getContentPane().add(jScrollPane1);
    jScrollPane1.setBounds(210, 150, 164, 94);
    jTextField1.setText("jTextField1");
    getContentPane().add(jTextField1);
    jTextField1.setBounds(240, 30, 140, 30);
    pack();
    }// </editor-fold>//GEN-END:initComponents
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new Vista().setVisible(true);
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JToggleButton jToggleButton1;
    // End of variables declaration//GEN-END:variables
    }

    When we execute the Swing application in windows
    vista environment.
    The look and feel of the swing components are
    displayed improperly.Improperly means what? You must be aware that Vista's native L&F certainly isn't supported yet.

  • What are the requirements to run a Swing application?

    I'm trying to send a simple swing application to a friend that has Mac OSX, but the buttons don't show up.
    Do people actually need the Java SDK in order for swing apps to work? Or is plain java enough? (He has normal java, because we play minecraft sometimes)
    Anyway, my buttons are not showing up on his computer, not even when I use the cross platform look at feel

    Here is the code I'm using, it's an application that makes the user select a folder and stuff will happen to it.
    import java.awt.Font;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.UIManager;
    import javax.swing.UnsupportedLookAndFeelException;
    public class SomeGUI extends JFrame implements ActionListener, Runnable
        public JButton exit;
        public JButton run;
        JPanel panel;
        JFileChooser chooser;
        String returnpath;
        JLabel progress;
      public SomeGUI()
         try
         UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
         catch (ClassNotFoundException ex)
             Logger.getLogger(SomeGUI.class.getName()).log(Level.SEVERE, null, ex);
         catch (InstantiationException ex)
             Logger.getLogger(SomeGUI.class.getName()).log(Level.SEVERE, null, ex);
         catch (IllegalAccessException ex)
             Logger.getLogger(SomeGUI.class.getName()).log(Level.SEVERE, null, ex);
         catch (UnsupportedLookAndFeelException ex)
             Logger.getLogger(SomeGUI.class.getName()).log(Level.SEVERE, null, ex);
          setTitle("BenkyoAdd");
          setSize(206,100);
          setResizable(false);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          setLocationRelativeTo(null);
          setVisible(true);
          panel = new JPanel();
          getContentPane().add(panel);
          panel.setLayout(null);
          run = new JButton("Run");
          run.setFocusable(false);
          run.setBounds(0,0,100,30);
          panel.add(run);
          run.addActionListener(this);
          progress = new JLabel("Please click run");
          progress.setFont(new Font("lol",Font.PLAIN,14));
          progress.setBounds(10, 30, 200, 50);
          panel.add(progress);
          exit = new JButton("Exit");
          exit.setFocusable(true);
          exit.setBounds(100, 0, 100, 30);
          panel.add(exit);
          exit.addActionListener(this);
          chooser = new JFileChooser();
          chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        public void actionPerformed(ActionEvent e)
         if(e.getSource().equals(exit))
             System.exit(0);
         if(e.getSource().equals(run))
             progress.setText("Select a folder...");
             chooser.showOpenDialog(panel);
             this.returnpath = chooser.getSelectedFile().getAbsolutePath();
             exit.setEnabled(false);
             run.setEnabled(false);
             progress.setText("Copying to output folder...");
             new Thread(this).start();
      public static void main(String args[])
          new SomeGUI();
        public void run()
         new Changer(this, this.returnpath);
         exit.setEnabled(true);
         exit.requestFocusInWindow();
         progress.setText("Done! You can now exit!");
    }

  • Using the JMS API in Java EE Applications

    Hello to all,
    this is some sort of theoretical question.
    I been reading the JMS documentation for a while.
    1.I could not understand what this statement means :
    >
    This section describes the ways in which using the JMS API in enterprise bean applications or web applications differs from using it in application clients.
    2. What is the difference to use the JMS in java EE web orEJB container and application client ?
    Thanks.

    peterwkc wrote:
    Hello to all,
    this is some sort of theoretical question.
    I been reading the JMS documentation for a while.
    1.I could not understand what this statement means :
    >
    This section describes the ways in which using the JMS API in enterprise bean applications or web applications differs from using it in application clients.
    What a developer is allowed to do is different depending on whether they are writing code to run in a container or not. The container already provides lots of services so some code you would write for outside a container is not needed when you write for a container. There are APIs that you are not allowed for in container code if you want to adhere to the spec.
    >
    2. What is the difference to use the JMS in java EE web orEJB container and application client ?
    Thanks.Read more of that document to find out the differences. Application components in Web/EJBs must not create more than one active session per connection while application clients are allowed to do so.

Maybe you are looking for