Google Groups Home
Help | Sign in
Some questions on Swing forms
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Ian Semmel  
View profile
 More options Jul 24, 3:40 pm
Newsgroups: comp.lang.java.gui
From: Ian Semmel <isemmelNOJ...@NOJUNKrocketcomp.com.au>
Date: Thu, 24 Jul 2008 19:40:47 GMT
Local: Thurs, Jul 24 2008 3:40 pm
Subject: Some questions on Swing forms
I am just getting started on this (and java), and have some seemingly basic questions

1. When you want to add your own code to a form, do you just add it to the form class file (ie this is for my own functions which
are not related to the code that you enter into framework-generated events etc).

2. Where do you actually put the code to display the initial values in text fields etc (ie is there some particular event exit). I
am actually using panels in a tabbed form.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roedy Green  
View profile
 More options Jul 24, 3:53 pm
Newsgroups: comp.lang.java.gui
From: Roedy Green <see_webs...@mindprod.com.invalid>
Date: Thu, 24 Jul 2008 19:53:13 GMT
Local: Thurs, Jul 24 2008 3:53 pm
Subject: Re: Some questions on Swing forms
On Thu, 24 Jul 2008 19:40:47 GMT, Ian Semmel
<isemmelNOJ...@NOJUNKrocketcomp.com.au> wrote, quoted or indirectly
quoted someone who said :

>1. When you want to add your own code to a form, do you just add it to the form class file (ie this is for my own functions which
>are not related to the code that you enter into framework-generated events etc).

There is no Form class file I am aware of.  You build JPanels and
arrange them into JFrames. The JPanels have various JComponents
arrayed on them with a layout mananger. Perhaps you are confusing
Swing with HTML forms.

There are quite different ways of operationg.  HTML Forms are a
primitive data input method available in browsers.  Swing is a
technique used with Applets, Java Webstart or stand alone Java apps.

--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Semmel  
View profile
 More options Jul 24, 7:43 pm
Newsgroups: comp.lang.java.gui
From: Ian Semmel <isemmelNOJ...@NOJUNKrocketcomp.com.au>
Date: Thu, 24 Jul 2008 23:43:45 GMT
Local: Thurs, Jul 24 2008 7:43 pm
Subject: Re: Some questions on Swing forms

It's my terminology that's confusing.

What I mean is eg a javax.swing.JDialog source file created when you create a Matisse form in say eclipse.

What I want to know is how do you know when all the fields have been created so that you can then use them.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roedy Green  
View profile
 More options Jul 25, 2:40 am
Newsgroups: comp.lang.java.gui
From: Roedy Green <see_webs...@mindprod.com.invalid>
Date: Fri, 25 Jul 2008 06:40:30 GMT
Local: Fri, Jul 25 2008 2:40 am
Subject: Re: Some questions on Swing forms
On Thu, 24 Jul 2008 23:43:45 GMT, Ian Semmel
<isemmelNOJ...@NOJUNKrocketcomp.com.au> wrote, quoted or indirectly
quoted someone who said :

>What I mean is eg a javax.swing.JDialog source file created when you create a Matisse form in say eclipse.

>What I want to know is how do you know when all the fields have been created so that you can then use them.

I have never used Matisse, so I don't know what sort of code it
generates.  I presume you can look at it.

I would expect all  the Components to be created and hooked up with
listeners in the constructor, so all should be ready to go. They might
use the addnotify mechanism.

See http://mindprod.com/jgloss/addnotify.html

see http://mindprod.com/jgloss/jdialog.html
for some background.

--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Semmel  
View profile
 More options Jul 25, 3:01 am
Newsgroups: comp.lang.java.gui
From: Ian Semmel <isemmelNOJ...@NOJUNKrocketcomp.com.au>
Date: Fri, 25 Jul 2008 07:01:36 GMT
Local: Fri, Jul 25 2008 3:01 am
Subject: Re: Some questions on Swing forms

Yes, those links seem to be about the trouble I was having (not that I fully understand them).

I moved things around in my program and now they seem to work. Previously, I had a null parent on the dialog, now I have a hidden
JFrame which I think is the answer.

Thanks for your help.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Karsten Lentzsch  
View profile
 More options Jul 25, 6:00 am
Newsgroups: comp.lang.java.gui
From: Karsten Lentzsch <kars...@jgoodies.com>
Date: Fri, 25 Jul 2008 12:00:30 +0200
Local: Fri, Jul 25 2008 6:00 am
Subject: Re: Some questions on Swing forms

Ian Semmel wrote:
> I am just getting started on this (and java), and have some seemingly
> basic questions

> 1. When you want to add your own code to a form, do you just add it to
> the form class file (ie this is for my own functions which are not
> related to the code that you enter into framework-generated events etc).

> 2. Where do you actually put the code to display the initial values in
> text fields etc (ie is there some particular event exit). I am actually
> using panels in a tabbed form.

I recommend to read Fowler's "Organizing Presentation Logic".
It describes the basic approaches for where to put what.

I provide a presentation at www.jgoodies.com/articles/
"Desktop Patterns & Data Binding" that adds some Java/Swing
related diagrams to Fowler's text.

You may also consider studying some of the tutorial sources
from my open source JGoodies Binding. There you can see how
a (stupid) view class is associated with a presentation logic
class that contains all the meat. The "EditorCopyingExample"
does not really use an automatic data binding, and so is the
simplest example, which may be good for a starting point. See
http://www.jgoodies.com/downloads/libraries.html
Get the Binding, extract it, look at "src/tutorial".

-Karsten


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google