• Advertisement

Archived

This topic is now archived and is closed to further replies.

[java] Swig in Windows applications?

This topic is 6410 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For those of you that use Forte for Java by Sun how did they get swig type buttons in a windows application did they make a port or what?

Share this post


Link to post
Share on other sites
Advertisement
I''ve never seen Forte for Java running, but my guess is that you have only two choices:

1. The program was written in Java. Only you can tell. I think it''s quite unlikely, but who know ?

2. They are using a Swing-like look-and-feel. The Win32 API features that cool WS_OWNERDRAW message that lets you draw windows (that includes buttons) the way you want. They''ve probably used this, because I don''t see much point in porting the whole component.

So, how did you like my two cents ?
~Lamtd

Share this post


Link to post
Share on other sites
I doubt it is in java cause it doesnt run in a browser and its not dos prompt so i guess its number 2

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
java programs don''t have to run in browsers or DOS prompts

Share this post


Link to post
Share on other sites
I use Forte and it IS written in Java. I downloaded the .class file and installed it (JDK required, of course). I never tried it in Linux though, cause I don''t have enough memory to run it smoothly.

I run it in the default (SWING) L&F, so I can''t quite understand your question....

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I use Forte and it IS written in Java. I downloaded the .class file and installed it (JDK required, of course). I never tried it in Linux though, cause I don''t have enough memory to run it smoothly.

I run it in the default (SWING) L&F, so I can''t quite understand your question....

Share this post


Link to post
Share on other sites
What is a "swig type button"?

Forte is definitely written in Java.

Archigamer, Java APPLETS run in web browsers, but Java APPLICATIONS run outside the browser. When you run Forte, you run a small batch file that runs the java application.

Share this post


Link to post
Share on other sites

Forte *is* a Swing application written in Java, and a serious resource hog. If you don''t have at least 128M it will wear on your last nerve. I have 512M RAM in a 700Mhz box here at work, so little piggy Forte gets all the ram and CPU it wants... I do think it is an excellent IDE, and I use it (almost)exclusively. It is nice to be able to switch to a different OS and still code in the same IDE. I''ve also used the open API to make some *twisted* IDE extensions .

As for not in browser, no DOS prompt, check into javaw.exe. Look in your your task manager and you''ll see javaw in there. I''m sure Sun (well, NetBeans, I suppose) just calls javaw from the native executable. Under most circumstances, if you run java.exe, you''ll get a DOS prompt, and if you run javaw.exe you won''t. javaw.exe is good for production code delivered to customers, NT services, etc... java.exe is useful for old school println/readln programs and debugging your app when its dumping stack traces left and right(hopefully someone elses app, not your own ).

ManaSink

Share this post


Link to post
Share on other sites
I liked Developer X2 better. It was Forte before sun bought it and it wasn''t a resource hog. I could at least run it on my 333MHz machine. Forte? no way, it takes a year to boot. I didn''t know about that javaw.exe thing either.

Share this post


Link to post
Share on other sites
I downloaded to see what it was like and I only had 48 mb of ram so it stopped responding often and it took forever to load a menu. (2 mins at least)

Share this post


Link to post
Share on other sites
Forte is a pig, but it has it its good points. NetBeans definately did a good job with Developer X2, that''s why I got Forte to begin with.

Visual Age is the best I''ve used for visual composition with beans. I haven''t got my hands on an Enterprise edition of JBuilder though, so there might be better.

Glad I could help with the javaw thing.

ManaSink

Share this post


Link to post
Share on other sites
Forte runs even better if you''ve got a dual processor system. We''ve got dual PIII 450MHz and dual PIII 600MHz machines here at work, all with 256MB of RAM, and Forte runs just fine. I''ve heard of people with faster single CPU''s and the same amount of RAM having performance problems. But Forte definitely takes advantage of multiple CPU''s!

Share this post


Link to post
Share on other sites
So how do you make theses types of applications? do you just make a regular applet and run it in javaw.exe or is there a entirly different api?

Share this post


Link to post
Share on other sites
You don''t make an applet. What you do is you put a "main" method in one of the classes

public static void main(String args[])
{
}

then you run it using the "java" command. The args array are all the command line arguments that appear after the name of the program separated by spaces. So if you have a main method in the class MyClass.java you''d run it like this:

java MyClass

and anything you type after "MyClass" would appear in the args array. You can set up a .bat file (or a shell script in UNIX) to run it, which is usually the best thing to do.

You could also write a little Windows program to execute it, but when all is said & done you have to run it in a Java Virtual Machine (which is what the "java" command does).


Share this post


Link to post
Share on other sites
Steve I don't think you read this entire post did you? I am talking about javaw.exe applications.

Edited by - ARCHIGAMER on July 5, 2000 11:47:46 AM

Share this post


Link to post
Share on other sites
I did, but I must have misunderstood what you were asking.

Forte, for example, is not a Windows application. There's a little executable that you can run, but all it does is start the jvm and run the Java application.



Edited by - SteveMeister on July 5, 2000 12:23:09 PM

Share this post


Link to post
Share on other sites
accroding to manasink you can make windowed applications in javaw.exe what I am asking is how do yu make these type of windoed applications that aren''t command line or run in a broswer.

Share this post


Link to post
Share on other sites
No, no, javaw is exactly the same command as java, but it doesn''t output anything to the command line. It''s like running the java application in the background.

Share this post


Link to post
Share on other sites
Archigamer, extending Applet or JApplet is only required to run as an applet in a browser. Any compiled java class that implements the main method can be executed as an application using java.exe or javaw.exe, the two runtime virtual machines provided by Sun. java.exe uses the command window(DOS prompt) it is run from for input and output, it also creates a new one if it is run from a shortcut, registry entry, etc... javaw.exe does not use a command window at all, so it appears to run ''in the background''. These can be run from a command line, or from a batch file, registry entry, etc... I am assuming you are using a Windows environment. Unix is a little different, and I''ll give you Unix specifics if you want.

Try compiling this class:


import javax.swing.*;
public class MyApp extends Object{
public static void main(String args[]){
System.out.println("Before");
JFrame jf = new JFrame("My Window");
jf.addWindowListener (new java.awt.event.WindowAdapter () {
public void windowClosing (java.awt.event.WindowEvent evt) {
System.exit(0);
}
});
jf.show();
System.out.println("After");
}
}


Create two windows shortcuts that set the working directory to where this compiled class is. Then set each to use a different command line:

One should use this:
java -cp . MyApp

The other:
javaw -cp . MyApp

you may have to modify these to use full path names, (IE "C:\jdk1.2\bin\java -cp . MyApp") if your jdk/bin directory is not listed in your PATH environment variable.

Both start up a VM and run the class as an application. java.exe will create a command window, javaw.exe will not.
You should notice that this class has nothing to do with applets or a browser. This is run as an application, much the way Forte is run.

SteveMeister did read the post and is giving you good advice, there seems to be an impedence mismatch. I think this code snippet should straighten everything out.

ManaSink

Share this post


Link to post
Share on other sites

  • Advertisement