Donald Bleyl | 1 Jul 2004 04:32
Picon
Favicon

RE: Swing and garbage collection

John,

A common idiom (for lack of a better word) with Swing apps is to have one 
parent JFrame, a
lightweight class w/ main method for bootstraping the program (and no 
fields), and a few helper classes that resemble SwingUtilities to manage 
functionality that doesn't belong in any one class. An example would be a 
WindowUtilities class that provides a center(Window) function.  Whether you 
use Singleton or static methods is an implementation detail.

The helper classes tend to add some generic functionality and not much 
state.  Similarly, a resource class can be used to externalize strings, load 
icons, etc.  For persisting
user preferences, checkout the Preferences API, which is easy to use and 
stores  info in the
registry when used on Windows.  Also, if you are doing Swing, it's essential 
to get your head around
the threading issues.

Foxtrot is a library that makes Swing threading easier, and is easy to use 
itself:
http://foxtrot.sourceforge.net/
The documentation describes the catch 22's of Swing threading.

Also,you should  use setVisible(boolean) instead of show/hide, which are 
deprecated as of 1.1.

>I have a swing application that is started by running a class called
>MainApp.  The class has a main method that creates an object of itself,
>creates a number of different JFrames and populates a few of its own
(Continue reading)

Picon
Picon

JSPs or servlets for VIEW --- looking for opinions..

Hey,,

JSP's or Servlets to generate the View (html) for an MVC architecture..

which one is better??

also, anyone heard of MVC Model 2+  (note the "+")

any comments are appreciated...

Don Lykins
AFSAC
937-257-4295 x4539
don.lykins@...
Barnes, Michael D | 1 Jul 2004 14:56
Favicon

RE: JSPs or servlets for VIEW --- looking for opinions..

>From my experience both options are equally valid choices. Personally
though, I like the servlet XSL combination since it makes it less likely
for the developer to embed business or data logic into the presentation
layer.

The JSP route is good since it is still being actively refined with the
advent of Java Faces which is a next generation JSP based as I
understand it on struts. If you do go the JSP route, look into custom
tags which will help componentized your presentation.

-----Original Message-----
From: ajug-members-bounces@...
[mailto:ajug-members-bounces@...] On Behalf Of Lykins Don H Contr
AFSAC/ITS
Sent: Thursday, July 01, 2004 8:34 AM
To: 'ajug-members@...'
Subject: [ajug-members] JSPs or servlets for VIEW --- looking for
opinions..

Hey,,

JSP's or Servlets to generate the View (html) for an MVC architecture..

which one is better??

also, anyone heard of MVC Model 2+  (note the "+")

any comments are appreciated...

Don Lykins
(Continue reading)

Ed Jenkins | 1 Jul 2004 15:17
Picon
Favicon

RE: Swing and garbage collection

I used have a function to center the window, but as of JDK 1.4, you can use this instead:

this.setLocationRelativeTo(null);

It's the last line in the constructor, after this.pack()

Ed

--- Donald Bleyl <donald_bleyl@...> wrote:
> John,
> 
> A common idiom (for lack of a better word) with Swing apps is to have one 
> parent JFrame, a
> lightweight class w/ main method for bootstraping the program (and no 
> fields), and a few helper classes that resemble SwingUtilities to manage 
> functionality that doesn't belong in any one class. An example would be a 
> WindowUtilities class that provides a center(Window) function.  Whether you 
> use Singleton or static methods is an implementation detail.
> 
> The helper classes tend to add some generic functionality and not much 
> state.  Similarly, a resource class can be used to externalize strings, load 
> icons, etc.  For persisting
> user preferences, checkout the Preferences API, which is easy to use and 
> stores  info in the
> registry when used on Windows.  Also, if you are doing Swing, it's essential 
> to get your head around
> the threading issues.
> 
> Foxtrot is a library that makes Swing threading easier, and is easy to use 
> itself:
(Continue reading)

Fuqua, Andrew (ISSAtlanta | 1 Jul 2004 16:14

RE: Swing and garbage collection

Why not just have the MainApp code pass itself to whoever needs it
before it finishes it's main()? Wouldn't that be the simplest thing? If
the other objects are hanging around, then MainApp must also.

Regards
Andrew Fuqua

-----Original Message-----
From: ajug-members-bounces@...
[mailto:ajug-members-bounces@...] On Behalf Of John Wells
Sent: Tuesday, June 29, 2004 11:14 PM
To: ajug-members@...
Subject: [ajug-members] Swing and garbage collection

I have a swing application that is started by running a class called
MainApp.  The class has a main method that creates an object of itself,
creates a number of different JFrames and populates a few of its own
fields with various objects.  It's never meant to be seen...more of a
common entry way into the application.

The problem is that I'd like it to remain in scope, so that the fields
that it instantiates are accessible for the entire lifetime of the
application.  This is because it creates a few common resources ( a
system tray icon if it's run on Windows, for example).

What's the accepted standard for persisting things like this in swing? 
What is this even called, so that I might google efficiently?
Currently, as soon as the execution thread has passed through it, it's
gone.  I tried causing it to extend JFrame and calling
objectname.hide(), but no luck, still garbage collected.
(Continue reading)

John Coctosen | 1 Jul 2004 17:59
Picon

Re: RE: JSPs or servlets for VIEW --- looking for opinions..

I prefer struts and jsp for the view portion of mvc, my experience
with servlets is that it can be clunky and tedious to display HTML
(which may be improved by the servlet XSL combo you mentioned)

I don't dislike JSF, but its billed alot as the improved struts and as
a current struts developer, I am more interested in the REAL struts
2.0.  I will be looking with great interest as the struts-jsf debate
moves forward.  I hope that they merge down the line rather than
having 2 competing frameworks.  I think both have their strong points
and it would be great to have them in one package rather than have to
make a choice.

Though to your point, I often am left with no choice but to include
business logic in the jsp.  Not often, but sometimes I am left with
little practical choice and it kills me.  Custom tags help, but often
slow my development and its "easier" (lazy) to stick it in.

And I don't want to use the list resources, but since I feel there
might be some interest, if any of you out there are interested in a
gmail invite, email me off the list and I'll help as many of you that
I can.  I have plenty of extras and figure this crowd might have a few
that are interested.

Matt Thebert

On Thu, 1 Jul 2004 07:56:49 -0500, Barnes, Michael D
<michael.barnes@...> wrote:
> 
> >From my experience both options are equally valid choices. Personally
> though, I like the servlet XSL combination since it makes it less likely
(Continue reading)

Angus Berry | 5 Jul 2004 18:14

JSF deployment options

Folks,

I'm looking at low cost deployment options for JSF, specifically choices
in addition to the obvious option of MyFaces. 

I see that Sun's Free 'Java System Application Server 8' supports JSF,
but is this just using the latest RI with the bug(s) (as discussed in
James Holmes presentation to AJUG) plugged in, or is it a production
capable implementation.

I'm not looking for full 'Enterprise' features and have nothing against
MyFaces, but I do need 'reasonable' performance. I just want to consider
the options and wonder if anyone on the list has any experience they'd
like to share.

thanks... Angus
James Holmes | 5 Jul 2004 20:38

RE: JSF deployment options

Angus,

I'd seriously consider MyFaces in lieu of the Sun reference implementation.
The Sun RI is broken in both versions (1.0 and 1.1).  There is also a known
performance problem in the Sun RI in both versions.

http://forum.java.sun.com/thread.jsp?forum=427&thread=503652

-James
JSF Resources and JSF Console GUI Tool
http://www.jamesholmes.com/JavaServerFaces/

-----Original Message-----
From: ajug-members-bounces@... [mailto:ajug-members-bounces@...]
On Behalf Of Angus Berry
Sent: Monday, July 05, 2004 11:14 AM
To: General AJUG membership forum (100-200 messages/month)
Subject: [ajug-members] JSF deployment options

Folks,

I'm looking at low cost deployment options for JSF, specifically choices
in addition to the obvious option of MyFaces. 

I see that Sun's Free 'Java System Application Server 8' supports JSF,
but is this just using the latest RI with the bug(s) (as discussed in
James Holmes presentation to AJUG) plugged in, or is it a production
capable implementation.

I'm not looking for full 'Enterprise' features and have nothing against
(Continue reading)

dave wible | 12 Jul 2004 15:44
Picon
Favicon

need help in configuring my wsad 5.1.1 jms setup

I am on a project where I'm supporting a configuration that at a minimum I can not duplicate in my own a simple project of my own.  I've looked at code examples for writing simple jms apps as well.  I have a jms config issue that I can't solve.  the MQManager doesn't get created and blows up before I'm able to use it!
 
here's a little code example that does not work for me as well. :-)
 
 
Thanks
_______________________________________________
ajug-members mailing list
ajug-members@...
http://www.ajug.org/mailman/listinfo/ajug-members
keith conner | 12 Jul 2004 16:02
Favicon

tomcat 5.0.25 manager console


This might seem elemetary but any help would be appreciated.
 Configuring Tomcat 5.0.25 and getting an "Admin is unavailable", also "Manager is unavailable" error msg
when clicking from TC home page on the Admin and Manager links. I have added roles to the tomcat-users.xml. 
as for the jsp examples that come with tc, they are working fine, and so are the applications ported to it. 

Thank you,
Keith Conner

_______________________________________________

Gmane