• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Hello Maha Anna !

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a doubt ! When we run any jav application we three buttons on the top right hand side of the application.
one for minimising
another for maximising
and the next for closing.
I would like to know how to have any one of these or none in my application.

In windows OS we have something called run (menuitem) in start button.
why cant i run a java program directly from that dialog box

Srivathsan Kris

Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Srivathsan Kris,
Since this is not that much related to nature of this forum, I take this post to Java-intermediate forum.
maha anna
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the second question, I have no idea offhand. For the first though, a few thoughts:
Frames have all three buttons. Dialogs only have the closing button. Both also have the method setResizeable(boolen) - if this is set to false for a Frame, the maximize button will be disabled (grayed out but still visible). The close button for a Frame or Dialog can be effectivey disabled by not assigning a WindowListener to actually perform the close - the button is still visible and looks functional, but doesn't do anything.
The only existing method I know to disable the minimize button is for a JInternalFrame, which has setIconifiable(boolean).
If you still can't get what you want, the best course may be to create your own custom component to do exactly what you want. This could be pretty involved - I'd try looking at the source code for Frame, and then either extend your own component, or if you need access to private data, then copy the code and alter it to create your own version of Frame. Should be fun. Good luck.
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For your 2nd request, If I understand your qstn correctly, you want to run a Java application by clicking Start-Run right? If so, here is the solution.
1. Compile and keep your .class file ready. Let us say it is HelloWorld.class. It is in a particular directory. Say it is c:\test. So we now have c:\test\HelloWorld.class.
2. Note that this is an independent application which has a our famous public static void main(String[] args) { } method defined in it.
3. Now you have to create a ****.jar file.
4. In order to do that foll. these steps.

(i) At Dos command line, Go to c:\test directory
(ii) Type jar -cf ExecuteMe.jar HelloWorld.class
(iii) Now a new Executable.jar file would have been created in
c:\test directory
(iv) Now we have
c:\test\HelloWorld.class (This is no-use after we create the ***.jar file
(v) Now create a run.bat file in any directory you want
The content of the run.bat file is the foll.
java -classpath c:\test\ExecuteMe.jar HelloWorld
create and save this run.bat file.
(vi) Note that the RED font in above line. This 'HelloWorld'
is the .class file which has the
'public static void main(String[] args) { }' method.
This is the program which is going to execute when you click
on the Start-run MenuItem.

Now everything is ready. Go to Start Menu. Click on the Run MenuItem .
Browse and pickup the run.bat file which you saved before. Now see..
Your Java Application runs. If your application would have been written with nice-frames it will look more good.
These are the bare minimum needed details for your requirement. You can do lot more with .jar file. If you want to know about jar. just type jar at the Dos command line, All options are explained. Also note that while creating the ****.jar file you can pack any number of .class files in the ***.jar file. Which means jar -cf ExecuteMe.jar App1.class App2.class somename.gif
When you want to execute someother program which is packed inside the .jar file just edit the run.bat file and chage the Application name which is shown above in RED color font.
For checking, I verified what I told above and it works for Maha
If you struck up anywhere please reply back.
maha anna

[This message has been edited by maha anna (edited April 19, 2000).]
Catch Ernie! Catch the egg! And catch this tiny ad too:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic