Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite?
Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #2400] Thu, 20 November 2003 13:14 Go to next message
Eclipse UserFriend
Originally posted by: use.reply.to.invalid

I would like to try out VE, but is somewhat taken back by Eclipse 2.1.2
listed as a prerequisite.

Does the provided code run as well under 3.0M4 which I use on a daily basis?
--
Thorbjoern Ravn Andersen "...plus...Tubular Bells!"
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #2430 is a reply to message #2400] Thu, 20 November 2003 15:12 Go to previous messageGo to next message
Peter Walker is currently offline Peter WalkerFriend
Messages: 124
Registered: July 2009
Senior Member
Thorbjoern,
As Dave Orme (VE project lead) mentioned in the eclipse.platform newsgroup:

"The 1.0 version will support 3.0. We're an Eclipse project now so we're
merging our development cycle with Eclipse's. But that will be a
process that won't happen overnight."

This is our next release.

Regards...
Peter Walker

"Thorbj
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #2459 is a reply to message #2400] Thu, 20 November 2003 15:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

0.5.0 will shortly be a release. Releases need to run on released
pre-reqs. 3.0M4 is still not a release, so we didn't want to pre-req it.
The current Eclipse release is 2.1.2. So that is why it is for 2.1.2.

And unfortunately, no it won't run on 3.0M4 because there have been
significant changes in parts of the base Eclipse code that causes the
editor to not work. The 1.0.0 development stream will eventually step up
to 3.0, but that won't be for a little while yet. There will be a major
API breaking change in 3.0 being released with 3.0M5, and we don't want
to spend our time doing two migrations. We only want to do it once.

We also have some important things we want to work on, like fixing some
of the larger performance problems and we want a stable platform for that.

--
Thanks, Rich Kulp

Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #2669 is a reply to message #2459] Fri, 21 November 2003 03:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ed.burnette.REMOVE.THIS.sas.com

Unless you like answering this question a *lot*, I strongly suggest you move
up to 3.0M* as soon as possible. The CDT project is doing that next week I
believe. Ideally, a project's HEAD would work with Platform's HEAD.

--
Ed Burnette, co-author, Eclipse in Action
www.eclipsepowered.org

"Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
news:bpilq9$b2q$1@eclipse.org...
> 0.5.0 will shortly be a release. Releases need to run on released
> pre-reqs. 3.0M4 is still not a release, so we didn't want to pre-req it.
> The current Eclipse release is 2.1.2. So that is why it is for 2.1.2.
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #3820 is a reply to message #2430] Fri, 21 November 2003 16:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: use.reply.to.invalid

Peter Walker wrote:

> Thorbjoern,
> As Dave Orme (VE project lead) mentioned in the eclipse.platform newsgroup:
>
> "The 1.0 version will support 3.0. We're an Eclipse project now so we're
> merging our development cycle with Eclipse's. But that will be a
> process that won't happen overnight."
>
> This is our next release.
>
> Regards...
> Peter Walker

Thank you for the response and the pointer. I'll just sit on my hands
for a while then :)

--
Thorbjoern Ravn Andersen "...plus...Tubular Bells!"
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #3827 is a reply to message #2669] Fri, 21 November 2003 17:21 Go to previous messageGo to next message
Bob Herrmann is currently offline Bob HerrmannFriend
Messages: 10
Registered: July 2009
Junior Member
Ed Burnette wrote:
> Unless you like answering this question a *lot*, I strongly suggest you move
> up to 3.0M* as soon as possible. The CDT project is doing that next week I
> believe. Ideally, a project's HEAD would work with Platform's HEAD.

The reasons for waiting to support 3.0M* seem sound, but since M4 is works
so darn well - I agree this will come up a great deal.

At a minium I recommend plastering the FAQ, and the Download page of VEP
with a note that it won't work with 3.0M* for a bit...

Cheers,
-bob

> --
> Ed Burnette, co-author, Eclipse in Action
> www.eclipsepowered.org

> "Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
> news:bpilq9$b2q$1@eclipse.org...
> > 0.5.0 will shortly be a release. Releases need to run on released
> > pre-reqs. 3.0M4 is still not a release, so we didn't want to pre-req it.
> > The current Eclipse release is 2.1.2. So that is why it is for 2.1.2.
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #5558 is a reply to message #3827] Wed, 26 November 2003 02:41 Go to previous messageGo to next message
David J. Orme is currently offline David J. OrmeFriend
Messages: 291
Registered: July 2009
Senior Member
Bob Herrmann wrote:
> Ed Burnette wrote:
>
>>Unless you like answering this question a *lot*, I strongly suggest you move
>>up to 3.0M* as soon as possible. The CDT project is doing that next week I
>>believe. Ideally, a project's HEAD would work with Platform's HEAD.
>
>
> The reasons for waiting to support 3.0M* seem sound, but since M4 is works
> so darn well - I agree this will come up a great deal.
>
> At a minium I recommend plastering the FAQ, and the Download page of VEP
> with a note that it won't work with 3.0M* for a bit...
>
> Cheers,
> -bob

Thanks! I think I'll do just that.


Regards,

Dave
--
Dave Orme
Eclipse Visual Editor Project Lead
Advanced Systems Concepts' Chief Architect
http://www.swtworkbench.com
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #5621 is a reply to message #5558] Wed, 26 November 2003 21:41 Go to previous messageGo to next message
Scott Ellsworth is currently offline Scott EllsworthFriend
Messages: 20
Registered: July 2009
Junior Member
In article <bq13vi$12s$1@eclipse.org>,
"David J. Orme" <daveo@asc-iseries.com> wrote:

> Bob Herrmann wrote:
> > Ed Burnette wrote:
> >
> >>Unless you like answering this question a *lot*, I strongly suggest you move
> >>up to 3.0M* as soon as possible. The CDT project is doing that next week I
> >>believe. Ideally, a project's HEAD would work with Platform's HEAD.
> >
> >
> > The reasons for waiting to support 3.0M* seem sound, but since M4 is works
> > so darn well - I agree this will come up a great deal.
> >
> > At a minium I recommend plastering the FAQ, and the Download page of VEP
> > with a note that it won't work with 3.0M* for a bit...
> >
> > Cheers,
> > -bob
>
> Thanks! I think I'll do just that.

I would also add an estimated date for that. It does not have to be
screamingly accurate, but it would be good to know whether the
synchronization with recent M builds is something I should look for in
December, or in Q32004.

It looks quite spiffy, and was one of the missing pieces for my own GUI
development. Congrats!

(BTW, I use MacOS X, so please do qualify it there.)

Scott
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #6515 is a reply to message #2669] Sun, 30 November 2003 14:31 Go to previous messageGo to next message
Johan Compagner is currently offline Johan CompagnerFriend
Messages: 148
Registered: July 2009
Senior Member
Why not make a version that can be dropped into 2.1.x series
and then completey merge the code base into the base of eclipse it self?
This kind of thing needs to be in the base. Not as a add on that won't
keep up directly with the latest release of the main..

johan



Ed Burnette wrote:
> Unless you like answering this question a *lot*, I strongly suggest you move
> up to 3.0M* as soon as possible. The CDT project is doing that next week I
> believe. Ideally, a project's HEAD would work with Platform's HEAD.
>
> --
> Ed Burnette, co-author, Eclipse in Action
> www.eclipsepowered.org
>
> "Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
> news:bpilq9$b2q$1@eclipse.org...
>
>>0.5.0 will shortly be a release. Releases need to run on released
>>pre-reqs. 3.0M4 is still not a release, so we didn't want to pre-req it.
>>The current Eclipse release is 2.1.2. So that is why it is for 2.1.2.
>
>
>
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #8084 is a reply to message #2430] Wed, 03 December 2003 21:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david.eclipsecat.com

Anyway to import Netbeans files into the visual editor and have them
come out looking right?

Peter Walker wrote:

> Thorbjoern,
> As Dave Orme (VE project lead) mentioned in the eclipse.platform newsgroup:
>
> "The 1.0 version will support 3.0. We're an Eclipse project now so we're
> merging our development cycle with Eclipse's. But that will be a
> process that won't happen overnight."
>
> This is our next release.
>
> Regards...
> Peter Walker
>
> "Thorbjørn Ravn Andersen" <use@reply.to.invalid> wrote in message
> news:bpiej0$o6$1@eclipse.org...
>
>>I would like to try out VE, but is somewhat taken back by Eclipse 2.1.2
>>listed as a prerequisite.
>>
>>Does the provided code run as well under 3.0M4 which I use on a daily
>
> basis?
>
>>--
>> Thorbjoern Ravn Andersen "...plus...Tubular Bells!"
>>
>
>
>
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #8145 is a reply to message #8084] Thu, 04 December 2003 14:03 Go to previous messageGo to next message
Peter Walker is currently offline Peter WalkerFriend
Messages: 124
Registered: July 2009
Senior Member
This is not officially supported and I haven't tried this yet... not sure
what the code looks like that comes out of Netbeans. If the code patterns
are such that each AWT/Swing component is declared in the class and has a
method that initializes it (i.e. jButton = new JButton()), it should work.
Please feel free to try it and report your results.

Thanks...
Peter walker

"David Siebert" <david@eclipsecat.com> wrote in message
news:bqllem$8ij$2@eclipse.org...
> Anyway to import Netbeans files into the visual editor and have them
> come out looking right?
>
> Peter Walker wrote:
>
> > Thorbjoern,
> > As Dave Orme (VE project lead) mentioned in the eclipse.platform
newsgroup:
> >
> > "The 1.0 version will support 3.0. We're an Eclipse project now so
we're
> > merging our development cycle with Eclipse's. But that will be a
> > process that won't happen overnight."
> >
> > This is our next release.
> >
> > Regards...
> > Peter Walker
> >
> > "Thorbj
VE importing NetBeans [message #8208 is a reply to message #8145] Thu, 04 December 2003 15:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david.eclipsecat.com

I did try it and it looks a little odd. Actually I tried it before I posted.
What is odd is that it looks like all of the elements are there but they
are not put together. I do not know it that is the way that VE supposed
to look or not. I just got Eclipse working and I am considering using it
instead of NetBeans. Net Beans has been very good to me but it is a
little slow.

Peter Walker wrote:
> This is not officially supported and I haven't tried this yet... not sure
> what the code looks like that comes out of Netbeans. If the code patterns
> are such that each AWT/Swing component is declared in the class and has a
> method that initializes it (i.e. jButton = new JButton()), it should work.
> Please feel free to try it and report your results.
>
> Thanks...
> Peter walker
>
> "David Siebert" <david@eclipsecat.com> wrote in message
> news:bqllem$8ij$2@eclipse.org...
>
>>Anyway to import Netbeans files into the visual editor and have them
>>come out looking right?
>>
>>Peter Walker wrote:
>>
>>
>>>Thorbjoern,
>>>As Dave Orme (VE project lead) mentioned in the eclipse.platform
>
> newsgroup:
>
>>>"The 1.0 version will support 3.0. We're an Eclipse project now so
>
> we're
>
>>>merging our development cycle with Eclipse's. But that will be a
>>>process that won't happen overnight."
>>>
>>>This is our next release.
>>>
>>>Regards...
>>>Peter Walker
>>>
>>>"Thorbjørn Ravn Andersen" <use@reply.to.invalid> wrote in message
>>>news:bpiej0$o6$1@eclipse.org...
>>>
>>>
>>>>I would like to try out VE, but is somewhat taken back by Eclipse 2.1.2
>>>>listed as a prerequisite.
>>>>
>>>>Does the provided code run as well under 3.0M4 which I use on a daily
>>>
>>>basis?
>>>
>>>
>>>>--
>>>> Thorbjoern Ravn Andersen "...plus...Tubular Bells!"
>>>>
>>>
>>>
>>>
>
>
Re: VE importing NetBeans [message #8277 is a reply to message #8208] Thu, 04 December 2003 17:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mendelgili.netscape.net

This is a multi-part message in MIME format.
--------------090206010809080200010505
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

David Siebert wrote:
> I did try it and it looks a little odd. Actually I tried it before I
> posted.
> What is odd is that it looks like all of the elements are there but they
> are not put together.

JVE has a default "getter" code pattern that will get more flexible as
we move forward. One can extend it (see pref. attachement)

If you provide a small src. code that you are trying to load JVE with,
and is not rendered the same as when it is run we can try and help you
understand the patterns differences.



I do not know it that is the way that VE supposed
> to look or not. I just got Eclipse working and I am considering using it
> instead of NetBeans. Net Beans has been very good to me but it is a
> little slow.
>
> Peter Walker wrote:
>
>> This is not officially supported and I haven't tried this yet... not sure
>> what the code looks like that comes out of Netbeans. If the code patterns
>> are such that each AWT/Swing component is declared in the class and has a
>> method that initializes it (i.e. jButton = new JButton()), it should
>> work.
>> Please feel free to try it and report your results.
>>
>> Thanks...
>> Peter walker
>>
>> "David Siebert" <david@eclipsecat.com> wrote in message
>> news:bqllem$8ij$2@eclipse.org...
>>
>>> Anyway to import Netbeans files into the visual editor and have them
>>> come out looking right?
>>>
>>> Peter Walker wrote:
>>>
>>>
>>>> Thorbjoern,
>>>> As Dave Orme (VE project lead) mentioned in the eclipse.platform
>>
>>
>> newsgroup:
>>
>>>> "The 1.0 version will support 3.0. We're an Eclipse project now so
>>
>>
>> we're
>>
>>>> merging our development cycle with Eclipse's. But that will be a
>>>> process that won't happen overnight."
>>>>
>>>> This is our next release.
>>>>
>>>> Regards...
>>>> Peter Walker
>>>>
>>>> "Thorbj
Re: VE importing NetBeans [message #8340 is a reply to message #8277] Thu, 04 December 2003 19:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david.eclipsecat.com

This is a multi-part message in MIME format.
--------------080300090806020007010700
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Here is the file I tried to export.
So far I find Eclipse to be pretty good. The Perl plugin seems to work
well. VE seems like it is a pretty nice piece of work but I have only
really just started to play with Eclipse. I have added two new features
to one of my programs today so I would say I am off to a good start.


--------------080300090806020007010700
Content-Type: text/plain;
name="AddCallDLG.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="AddCallDLG.java"

/*
* AddCallDLG.java
*
* Created on July 16, 2001, 1:57 PM
*/


/**
*
* @author david
* @version
*/
/* Todo
* Make it so you pass a Phone call to the dialog and it fills it in fo you.
*
**/
import javax.swing.JComboBox;
import java.util.ArrayList;

public class AddCallDLG extends javax.swing.JDialog {
private ErrorLogging m_oErrLog;
private int i_switch=0;
String m_sAccountNO;
private String m_phone, m_phone2;
boolean m_bOkay=false;
private boolean m_bfcall=false;
javax.swing.JList m_oCallList;
private PhoneCall m_oPhoneCall;
private MyDataBase m_oDB;
/** Creates new form AddCallDLG */

public AddCallDLG(PhoneMainFrame parent,boolean modal,PhoneCall p_phone,ErrorLogging errorlog) {
super(parent, modal);
//PhoneMainFrame mf = (PhoneMainFrame) parent;
m_oDB=parent.o_SqlConnection;
m_oErrLog=errorlog;
m_oPhoneCall=p_phone;
initComponents();
pack();
}

public int getStatusData(String name){
int retval=0;
try{
java.sql.Statement stmt = m_oDB.m_sqlConnection.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("Select * FROM phonegroups WHERE pgroup = '"+name+"'");
PhoneUser t_phoneuser=null;
//create an ArrayList of PhoneCalls
if (rs.next()){
retval=1;
}
else {
rs = stmt.executeQuery("Select * FROM phoneusers WHERE username= '"+name+"'");
//create an ArrayList of PhoneCalls
if (rs.next()){
t_phoneuser = new PhoneUser(m_oDB,rs);
retval=t_phoneuser.getUserStatus();
}

}
} catch (Exception ex){
// TODO Add more errorchecking code here.
System.err.println(ex.toString());

}
return retval;
}
/** 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 FormEditor.
*/
private void initComponents() {//GEN-BEGIN:initComponents
java.awt.GridBagConstraints gridBagConstraints;

jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
nameJTextField = new javax.swing.JTextField();
phoneJTextField = new javax.swing.JTextField();
phone2JTextField = new javax.swing.JTextField();
statusjComboBox = new javax.swing.JComboBox();
jTextFieldNotes = new javax.swing.JTextField();
jButtonOk = new javax.swing.JButton();
cancle = new javax.swing.JButton();
prijLabel = new javax.swing.JLabel();
priComboBox = new javax.swing.JComboBox();
forjLabel = new javax.swing.JLabel();
jComboBoxFor = new javax.swing.JComboBox();
jButtionJSwitch = new javax.swing.JButton();

getContentPane().setLayout(new java.awt.GridBagLayout());

setTitle("Add a Call");
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}
});

addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
closeDialog(evt);
}
});

jLabel1.setDisplayedMnemonic('N');
jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel1.setLabelFor(nameJTextField);
jLabel1.setText("Name");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(jLabel1, gridBagConstraints);

jLabel2.setDisplayedMnemonic('P');
jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel2.setLabelFor(phoneJTextField);
jLabel2.setText("Phone");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(jLabel2, gridBagConstraints);

jLabel3.setDisplayedMnemonic('2');
jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel3.setLabelFor(phone2JTextField);
jLabel3.setText("Phone2");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(jLabel3, gridBagConstraints);

jLabel4.setDisplayedMnemonic('a');
jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel4.setLabelFor(statusjComboBox);
jLabel4.setText("Status");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(jLabel4, gridBagConstraints);

jLabel5.setDisplayedMnemonic('t');
jLabel5.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel5.setLabelFor(jTextFieldNotes);
jLabel5.setText("Note");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 5;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(jLabel5, gridBagConstraints);

nameJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
nameJTextFieldFocusGained(evt);
}
});

nameJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
nameJTextFieldKeyTyped(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
gridBagConstraints.gridwidth = 5;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 396;
gridBagConstraints.ipady = 10;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
getContentPane().add(nameJTextField, gridBagConstraints);

phoneJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
phoneJTextFieldFocusGained(evt);
}
});

phoneJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
phoneJTextFieldKeyTyped(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.gridwidth = 4;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 396;
gridBagConstraints.ipady = 10;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
getContentPane().add(phoneJTextField, gridBagConstraints);

phone2JTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
phone2JTextFieldFocusGained(evt);
}
});

phone2JTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
phone2JTextFieldKeyTyped(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 2;
gridBagConstraints.gridwidth = 4;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 396;
gridBagConstraints.ipady = 10;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
getContentPane().add(phone2JTextField, gridBagConstraints);

statusjComboBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
statusjComboBoxActionPerformed(evt);
}
});

statusjComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
statusjComboBoxMouseWheelMoved(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
getContentPane().add(statusjComboBox, gridBagConstraints);

jTextFieldNotes.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextFieldNotesFocusGained(evt);
}
});

jTextFieldNotes.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jTextFieldNotesKeyTyped(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 5;
gridBagConstraints.gridwidth = 5;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 500;
gridBagConstraints.ipady = 10;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
getContentPane().add(jTextFieldNotes, gridBagConstraints);

jButtonOk.setMnemonic('O');
jButtonOk.setText("Ok");
jButtonOk.setSelected(true);
jButtonOk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonOkActionPerformed(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 6;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
getContentPane().add(jButtonOk, gridBagConstraints);

cancle.setMnemonic('C');
cancle.setText("Cancel");
cancle.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancleActionPerformed(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 5;
gridBagConstraints.gridy = 6;
gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
getContentPane().add(cancle, gridBagConstraints);

prijLabel.setDisplayedMnemonic('r');
prijLabel.setFont(new java.awt.Font("Dialog", 0, 14));
prijLabel.setLabelFor(priComboBox);
prijLabel.setText("Priority ");
prijLabel.setName("Add Call");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 3;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
getContentPane().add(prijLabel, gridBagConstraints);

priComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
priComboBoxMouseWheelMoved(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 4;
gridBagConstraints.gridy = 3;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
getContentPane().add(priComboBox, gridBagConstraints);

forjLabel.setDisplayedMnemonic('F');
forjLabel.setFont(new java.awt.Font("Dialog", 0, 14));
forjLabel.setLabelFor(jComboBoxFor);
forjLabel.setText("For");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 4;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(forjLabel, gridBagConstraints);

jComboBoxFor.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(java.awt.event.MouseEvent evt) {
jComboBoxForMouseReleased(evt);
}
});

jComboBoxFor.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
jComboBoxForMouseWheelMoved(evt);
}
});

jComboBoxFor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
jComboBoxForPropertyChange(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 4;
gridBagConstraints.gridwidth = 5;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 260;
gridBagConstraints.ipady = 5;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
getContentPane().add(jComboBoxFor, gridBagConstraints);

jButtionJSwitch.setMnemonic('S');
jButtionJSwitch.setText("Switch");
jButtionJSwitch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtionJSwitchActionPerformed(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 5;
gridBagConstraints.gridy = 1;
gridBagConstraints.gridheight = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
getContentPane().add(jButtionJSwitch, gridBagConstraints);

}//GEN-END:initComponents

private void jTextFieldNotesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldNotesFocusGained
// Add your handling code here:
if(this.m_bfcall){
this.jTextFieldNotes.setCaretPosition(this.jTextFieldNotes.g etText().length());
} else this.setSelectTextAll(this.jTextFieldNotes);
}//GEN-LAST:event_jTextFieldNotesFocusGained

private void phone2JTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phone2JTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.phone2JTextField);
}//GEN-LAST:event_phone2JTextFieldFocusGained

private void nameJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_nameJTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.nameJTextField);
}//GEN-LAST:event_nameJTextFieldFocusGained

private void phoneJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phoneJTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.phoneJTextField);
}//GEN-LAST:event_phoneJTextFieldFocusGained
private static void setSelectTextAll(javax.swing.JTextField textField){
textField.setSelectionStart(0);
textField.setSelectionEnd(textField.getText().length());
}
private void jComboBoxForMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_jComboBoxForMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.jComboBoxFor);
}//GEN-LAST:event_jComboBoxForMouseWheelMoved

private void statusjComboBoxMouseWheelMoved(java.awt.event.MouseWheelEven t evt) {//GEN-FIRST:event_statusjComboBoxMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.statusjComboBox);
}//GEN-LAST:event_statusjComboBoxMouseWheelMoved

private void scrollWheelComboBox(java.awt.event.MouseWheelEvent evt, javax.swing.JComboBox cBox){
int i_inc = +1;
if(evt.getWheelRotation()<0) {i_inc=-1;}
int pos=cBox.getSelectedIndex()+i_inc;
if(pos>=cBox.getItemCount()) pos=0;
if(pos<0) pos=cBox.getItemCount()-1;
cBox.setSelectedIndex(pos);
}
private void priComboBoxMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_priComboBoxMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.priComboBox);
}//GEN-LAST:event_priComboBoxMouseWheelMoved

private void jComboBoxForMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxForMouseReleased
// Add your handling code here:
String user =(String)this.jComboBoxFor.getSelectedItem();
if (user!=null) if (getStatusData(user)==0){
System.err.println("not On Phone");
}
}//GEN-LAST:event_jComboBoxForMouseReleased

private void jComboBoxForPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jComboBoxForPropertyChange
// Add your handling code here:
String user =(String)this.jComboBoxFor.getSelectedItem();
if (user!=null) if (getStatusData(user)==0){
new NotHereDLG(new javax.swing.JFrame(), true,user).show();
}
}//GEN-LAST:event_jComboBoxForPropertyChange

private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
// Add your handling code here:
checkTextFieldLen(jTextFieldNotes,3998);
checkTextFieldLen(phone2JTextField,39);
checkTextFieldLen(phoneJTextField,39);
checkTextFieldLen(nameJTextField,79);
if(this.m_bfcall){
this.priComboBox.setSelectedIndex(1);
javax.swing.JOptionPane.showMessageDialog(this,"First Call");
}
}//GEN-LAST:event_formComponentShown

private void jTextFieldNotesKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldNotesKeyTyped
// Add your handling code here:
checkTextFieldLen(jTextFieldNotes,3998);
}//GEN-LAST:event_jTextFieldNotesKeyTyped

private void phone2JTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phone2JTextFieldKeyTyped
// Add your handling code here:
checkTextFieldLen(phone2JTextField,39);
}//GEN-LAST:event_phone2JTextFieldKeyTyped

private void phoneJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phoneJTextFieldKeyTyped
checkTextFieldLen(phoneJTextField,39);
// Add your handling code here:
}//GEN-LAST:event_phoneJTextFieldKeyTyped

private void nameJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nameJTextFieldKeyTyped
// Add your handling code here:
checkTextFieldLen(nameJTextField,79);
}//GEN-LAST:event_nameJTextFieldKeyTyped

private void jButtionJSwitchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtionJSwitchActionPerformed
// Add your handling code here:
switch(i_switch){
case 0:
i_switch++;
phoneJTextField.setText(m_phone2);
phone2JTextField.setText(m_phone);
break;
case 1:
i_switch++;
phoneJTextField.setText("");
phone2JTextField.setText(m_phone);
phoneJTextField.requestFocus();
break;
default :
i_switch=0;
phoneJTextField.setText(m_phone);
phone2JTextField.setText(m_phone2);
}
}//GEN-LAST:event_jButtionJSwitchActionPerformed
private void checkTextFieldLen(javax.swing.JTextField f, int size){
String text= f.getText();
if(text.length()>size){
text=text.substring(0,size);
f.setText(text);
}
}
private void cancleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancleActionPerformed
// Add your handling code here:
setVisible(false);
dispose();
}//GEN-LAST:event_cancleActionPerformed

private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
// Add your handling code here:
this.m_bOkay=true;
m_oPhoneCall.setPhoneCall( nameJTextField.getText(), phoneJTextField.getText(), phone2JTextField.getText(),"", jComboBoxFor.getSelectedItem().toString() ,jTextFieldNotes.getText(),priComboBox.getSelectedItem().toS tring(),statusjComboBox.getSelectedItem().toString(),m_oDB);
setVisible(false);
}//GEN-LAST:event_jButtonOkActionPerformed

private void statusjComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_statusjComboBoxActionPerformed
// Add your handling code here:
}//GEN-LAST:event_statusjComboBoxActionPerformed

/** Closes the dialog */
private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
setVisible(false);
dispose();
}//GEN-LAST:event_closeDialog

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
//new AddCallDLG (new javax.swing.JFrame (), true).show ();
}

public void setPriList(String [] p_saList) {
for(int i=0;i<p_saList.length;i++){
this.priComboBox.addItem(makeObj(p_saList[i]));

}
}

public void setStatusList(String [] p_saList) {
for(int i=0;i<p_saList.length;i++){
this.statusjComboBox.addItem(makeObj(p_saList[i]));
}
}


public void setCallerListName(String name){
int inx=this.jComboBoxFor.getItemCount()-1;
while (inx>0 && ((String)this.jComboBoxFor.getItemAt(inx)).equalsIgnoreCase( name)== false){
inx--;
}
this.jComboBoxFor.setSelectedIndex(inx);
}

public void setCallerList(ArrayList p_saList) {
for(int i=0;i<p_saList.size();i++){
this.jComboBoxFor.addItem(p_saList.get(i));
}
}

public PhoneCall getPhoneCall(){
//public PhoneCall(String p_sCaller, String p_sPhone, String p_sPhone2, String p_sQedBy, String p_sFor, String p_sNotes, String p_sPri,String p_sStatus)
PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(), "",(String)jComboBoxFor.getSelectedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
return (pcall);
}
public PhoneCall getPhoneCall(String UserID){
PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(),UserID,(String)jComboBoxFor.getS electedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
return (pcall);
}

private Object makeObj(final String item) {
return new Object() { public String toString() { return item; } };
}

public void setCustInfo(String name, String phone, String phone2, String accountno){
nameJTextField.setText(name);
phoneJTextField.setText(phone);
m_phone=phone;
phone2JTextField.setText(phone2);
m_phone2=phone2;
this.m_sAccountNO=accountno;
if(this.m_oPhoneCall.isFirstCall(m_oDB,name)){
System.err.println("FirstCall");
this.jTextFieldNotes.setText("First Call:");
this.m_bfcall=true;
} else System.err.println("not F call");
}

public void setCallList(javax.swing.JList p_list){
m_oCallList=p_list;
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField phone2JTextField;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField phoneJTextField;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel prijLabel;
private javax.swing.JComboBox statusjComboBox;
private javax.swing.JButton cancle;
private javax.swing.JTextField jTextFieldNotes;
private javax.swing.JButton jButtonOk;
private javax.swing.JTextField nameJTextField;
private javax.swing.JButton jButtionJSwitch;
private javax.swing.JComboBox priComboBox;
private javax.swing.JComboBox jComboBoxFor;
private javax.swing.JLabel forjLabel;
private javax.swing.JLabel jLabel5;
// End of variables declaration//GEN-END:variables

}

--------------080300090806020007010700--
Re: VE importing NetBeans [message #8516 is a reply to message #8340] Fri, 05 December 2003 13:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mendelgili.netscape.net

This is a multi-part message in MIME format.
--------------010807050909080305090803
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

There are two pattern issues that inhibits VE to parse this code properly:

1. implicit content pane. VE requires (in this version) to explicitly
declare a content pane.

2. When using GridBag constraints, you will have to declare a unique
constraint for each component you are adding ... the code above reuse
the same variable (yet still allocate a new one).

I modified the code by hand, so that you can diff the files. Note that
there are many compile errors in the file, as this code reference
classes that are not available. The beauty of VE is that compile errors
that are not relevant are ignored.

David Siebert wrote:
> Here is the file I tried to export.
> So far I find Eclipse to be pretty good. The Perl plugin seems to work
> well. VE seems like it is a pretty nice piece of work but I have only
> really just started to play with Eclipse. I have added two new features
> to one of my programs today so I would say I am off to a good start.
>
>
> ------------------------------------------------------------ ------------
>
> /*
> * AddCallDLG.java
> *
> * Created on July 16, 2001, 1:57 PM
> */
>
>
> /**
> *
> * @author david
> * @version
> */
> /* Todo
> * Make it so you pass a Phone call to the dialog and it fills it in fo you.
> *
> **/
> import javax.swing.JComboBox;
> import java.util.ArrayList;
>
> public class AddCallDLG extends javax.swing.JDialog {
> private ErrorLogging m_oErrLog;
> private int i_switch=0;
> String m_sAccountNO;
> private String m_phone, m_phone2;
> boolean m_bOkay=false;
> private boolean m_bfcall=false;
> javax.swing.JList m_oCallList;
> private PhoneCall m_oPhoneCall;
> private MyDataBase m_oDB;
> /** Creates new form AddCallDLG */
>
> public AddCallDLG(PhoneMainFrame parent,boolean modal,PhoneCall p_phone,ErrorLogging errorlog) {
> super(parent, modal);
> //PhoneMainFrame mf = (PhoneMainFrame) parent;
> m_oDB=parent.o_SqlConnection;
> m_oErrLog=errorlog;
> m_oPhoneCall=p_phone;
> initComponents();
> pack();
> }
>
> public int getStatusData(String name){
> int retval=0;
> try{
> java.sql.Statement stmt = m_oDB.m_sqlConnection.createStatement();
> java.sql.ResultSet rs = stmt.executeQuery("Select * FROM phonegroups WHERE pgroup = '"+name+"'");
> PhoneUser t_phoneuser=null;
> //create an ArrayList of PhoneCalls
> if (rs.next()){
> retval=1;
> }
> else {
> rs = stmt.executeQuery("Select * FROM phoneusers WHERE username= '"+name+"'");
> //create an ArrayList of PhoneCalls
> if (rs.next()){
> t_phoneuser = new PhoneUser(m_oDB,rs);
> retval=t_phoneuser.getUserStatus();
> }
>
> }
> } catch (Exception ex){
> // TODO Add more errorchecking code here.
> System.err.println(ex.toString());
>
> }
> return retval;
> }
> /** 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 FormEditor.
> */
> private void initComponents() {//GEN-BEGIN:initComponents
> java.awt.GridBagConstraints gridBagConstraints;
>
> jLabel1 = new javax.swing.JLabel();
> jLabel2 = new javax.swing.JLabel();
> jLabel3 = new javax.swing.JLabel();
> jLabel4 = new javax.swing.JLabel();
> jLabel5 = new javax.swing.JLabel();
> nameJTextField = new javax.swing.JTextField();
> phoneJTextField = new javax.swing.JTextField();
> phone2JTextField = new javax.swing.JTextField();
> statusjComboBox = new javax.swing.JComboBox();
> jTextFieldNotes = new javax.swing.JTextField();
> jButtonOk = new javax.swing.JButton();
> cancle = new javax.swing.JButton();
> prijLabel = new javax.swing.JLabel();
> priComboBox = new javax.swing.JComboBox();
> forjLabel = new javax.swing.JLabel();
> jComboBoxFor = new javax.swing.JComboBox();
> jButtionJSwitch = new javax.swing.JButton();
>
> getContentPane().setLayout(new java.awt.GridBagLayout());
>
> setTitle("Add a Call");
> addComponentListener(new java.awt.event.ComponentAdapter() {
> public void componentShown(java.awt.event.ComponentEvent evt) {
> formComponentShown(evt);
> }
> });
>
> addWindowListener(new java.awt.event.WindowAdapter() {
> public void windowClosing(java.awt.event.WindowEvent evt) {
> closeDialog(evt);
> }
> });
>
> jLabel1.setDisplayedMnemonic('N');
> jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel1.setLabelFor(nameJTextField);
> jLabel1.setText("Name");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 0;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(jLabel1, gridBagConstraints);
>
> jLabel2.setDisplayedMnemonic('P');
> jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel2.setLabelFor(phoneJTextField);
> jLabel2.setText("Phone");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 1;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(jLabel2, gridBagConstraints);
>
> jLabel3.setDisplayedMnemonic('2');
> jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel3.setLabelFor(phone2JTextField);
> jLabel3.setText("Phone2");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 2;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(jLabel3, gridBagConstraints);
>
> jLabel4.setDisplayedMnemonic('a');
> jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel4.setLabelFor(statusjComboBox);
> jLabel4.setText("Status");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 3;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(jLabel4, gridBagConstraints);
>
> jLabel5.setDisplayedMnemonic('t');
> jLabel5.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel5.setLabelFor(jTextFieldNotes);
> jLabel5.setText("Note");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 5;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(jLabel5, gridBagConstraints);
>
> nameJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> nameJTextFieldFocusGained(evt);
> }
> });
>
> nameJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> nameJTextFieldKeyTyped(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 0;
> gridBagConstraints.gridwidth = 5;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.ipadx = 396;
> gridBagConstraints.ipady = 10;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> getContentPane().add(nameJTextField, gridBagConstraints);
>
> phoneJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> phoneJTextFieldFocusGained(evt);
> }
> });
>
> phoneJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> phoneJTextFieldKeyTyped(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 1;
> gridBagConstraints.gridwidth = 4;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.ipadx = 396;
> gridBagConstraints.ipady = 10;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> getContentPane().add(phoneJTextField, gridBagConstraints);
>
> phone2JTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> phone2JTextFieldFocusGained(evt);
> }
> });
>
> phone2JTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> phone2JTextFieldKeyTyped(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 2;
> gridBagConstraints.gridwidth = 4;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.ipadx = 396;
> gridBagConstraints.ipady = 10;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> getContentPane().add(phone2JTextField, gridBagConstraints);
>
> statusjComboBox.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> statusjComboBoxActionPerformed(evt);
> }
> });
>
> statusjComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> statusjComboBoxMouseWheelMoved(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 3;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> getContentPane().add(statusjComboBox, gridBagConstraints);
>
> jTextFieldNotes.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> jTextFieldNotesFocusGained(evt);
> }
> });
>
> jTextFieldNotes.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> jTextFieldNotesKeyTyped(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 5;
> gridBagConstraints.gridwidth = 5;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.ipadx = 500;
> gridBagConstraints.ipady = 10;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> getContentPane().add(jTextFieldNotes, gridBagConstraints);
>
> jButtonOk.setMnemonic('O');
> jButtonOk.setText("Ok");
> jButtonOk.setSelected(true);
> jButtonOk.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> jButtonOkActionPerformed(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 6;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> getContentPane().add(jButtonOk, gridBagConstraints);
>
> cancle.setMnemonic('C');
> cancle.setText("Cancel");
> cancle.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> cancleActionPerformed(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 5;
> gridBagConstraints.gridy = 6;
> gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
> gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> getContentPane().add(cancle, gridBagConstraints);
>
> prijLabel.setDisplayedMnemonic('r');
> prijLabel.setFont(new java.awt.Font("Dialog", 0, 14));
> prijLabel.setLabelFor(priComboBox);
> prijLabel.setText("Priority ");
> prijLabel.setName("Add Call");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 2;
> gridBagConstraints.gridy = 3;
> gridBagConstraints.gridwidth = 2;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> getContentPane().add(prijLabel, gridBagConstraints);
>
> priComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> priComboBoxMouseWheelMoved(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 4;
> gridBagConstraints.gridy = 3;
> gridBagConstraints.gridwidth = 2;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> getContentPane().add(priComboBox, gridBagConstraints);
>
> forjLabel.setDisplayedMnemonic('F');
> forjLabel.setFont(new java.awt.Font("Dialog", 0, 14));
> forjLabel.setLabelFor(jComboBoxFor);
> forjLabel.setText("For");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 4;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(forjLabel, gridBagConstraints);
>
> jComboBoxFor.addMouseListener(new java.awt.event.MouseAdapter() {
> public void mouseReleased(java.awt.event.MouseEvent evt) {
> jComboBoxForMouseReleased(evt);
> }
> });
>
> jComboBoxFor.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> jComboBoxForMouseWheelMoved(evt);
> }
> });
>
> jComboBoxFor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
> public void propertyChange(java.beans.PropertyChangeEvent evt) {
> jComboBoxForPropertyChange(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 4;
> gridBagConstraints.gridwidth = 5;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.ipadx = 260;
> gridBagConstraints.ipady = 5;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> getContentPane().add(jComboBoxFor, gridBagConstraints);
>
> jButtionJSwitch.setMnemonic('S');
> jButtionJSwitch.setText("Switch");
> jButtionJSwitch.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> jButtionJSwitchActionPerformed(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 5;
> gridBagConstraints.gridy = 1;
> gridBagConstraints.gridheight = 2;
> gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> getContentPane().add(jButtionJSwitch, gridBagConstraints);
>
> }//GEN-END:initComponents
>
> private void jTextFieldNotesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldNotesFocusGained
> // Add your handling code here:
> if(this.m_bfcall){
> this.jTextFieldNotes.setCaretPosition(this.jTextFieldNotes.g etText().length());
> } else this.setSelectTextAll(this.jTextFieldNotes);
> }//GEN-LAST:event_jTextFieldNotesFocusGained
>
> private void phone2JTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phone2JTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.phone2JTextField);
> }//GEN-LAST:event_phone2JTextFieldFocusGained
>
> private void nameJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_nameJTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.nameJTextField);
> }//GEN-LAST:event_nameJTextFieldFocusGained
>
> private void phoneJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phoneJTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.phoneJTextField);
> }//GEN-LAST:event_phoneJTextFieldFocusGained
> private static void setSelectTextAll(javax.swing.JTextField textField){
> textField.setSelectionStart(0);
> textField.setSelectionEnd(textField.getText().length());
> }
> private void jComboBoxForMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_jComboBoxForMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.jComboBoxFor);
> }//GEN-LAST:event_jComboBoxForMouseWheelMoved
>
> private void statusjComboBoxMouseWheelMoved(java.awt.event.MouseWheelEven t evt) {//GEN-FIRST:event_statusjComboBoxMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.statusjComboBox);
> }//GEN-LAST:event_statusjComboBoxMouseWheelMoved
>
> private void scrollWheelComboBox(java.awt.event.MouseWheelEvent evt, javax.swing.JComboBox cBox){
> int i_inc = +1;
> if(evt.getWheelRotation()<0) {i_inc=-1;}
> int pos=cBox.getSelectedIndex()+i_inc;
> if(pos>=cBox.getItemCount()) pos=0;
> if(pos<0) pos=cBox.getItemCount()-1;
> cBox.setSelectedIndex(pos);
> }
> private void priComboBoxMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_priComboBoxMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.priComboBox);
> }//GEN-LAST:event_priComboBoxMouseWheelMoved
>
> private void jComboBoxForMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxForMouseReleased
> // Add your handling code here:
> String user =(String)this.jComboBoxFor.getSelectedItem();
> if (user!=null) if (getStatusData(user)==0){
> System.err.println("not On Phone");
> }
> }//GEN-LAST:event_jComboBoxForMouseReleased
>
> private void jComboBoxForPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jComboBoxForPropertyChange
> // Add your handling code here:
> String user =(String)this.jComboBoxFor.getSelectedItem();
> if (user!=null) if (getStatusData(user)==0){
> new NotHereDLG(new javax.swing.JFrame(), true,user).show();
> }
> }//GEN-LAST:event_jComboBoxForPropertyChange
>
> private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
> // Add your handling code here:
> checkTextFieldLen(jTextFieldNotes,3998);
> checkTextFieldLen(phone2JTextField,39);
> checkTextFieldLen(phoneJTextField,39);
> checkTextFieldLen(nameJTextField,79);
> if(this.m_bfcall){
> this.priComboBox.setSelectedIndex(1);
> javax.swing.JOptionPane.showMessageDialog(this,"First Call");
> }
> }//GEN-LAST:event_formComponentShown
>
> private void jTextFieldNotesKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldNotesKeyTyped
> // Add your handling code here:
> checkTextFieldLen(jTextFieldNotes,3998);
> }//GEN-LAST:event_jTextFieldNotesKeyTyped
>
> private void phone2JTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phone2JTextFieldKeyTyped
> // Add your handling code here:
> checkTextFieldLen(phone2JTextField,39);
> }//GEN-LAST:event_phone2JTextFieldKeyTyped
>
> private void phoneJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phoneJTextFieldKeyTyped
> checkTextFieldLen(phoneJTextField,39);
> // Add your handling code here:
> }//GEN-LAST:event_phoneJTextFieldKeyTyped
>
> private void nameJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nameJTextFieldKeyTyped
> // Add your handling code here:
> checkTextFieldLen(nameJTextField,79);
> }//GEN-LAST:event_nameJTextFieldKeyTyped
>
> private void jButtionJSwitchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtionJSwitchActionPerformed
> // Add your handling code here:
> switch(i_switch){
> case 0:
> i_switch++;
> phoneJTextField.setText(m_phone2);
> phone2JTextField.setText(m_phone);
> break;
> case 1:
> i_switch++;
> phoneJTextField.setText("");
> phone2JTextField.setText(m_phone);
> phoneJTextField.requestFocus();
> break;
> default :
> i_switch=0;
> phoneJTextField.setText(m_phone);
> phone2JTextField.setText(m_phone2);
> }
> }//GEN-LAST:event_jButtionJSwitchActionPerformed
> private void checkTextFieldLen(javax.swing.JTextField f, int size){
> String text= f.getText();
> if(text.length()>size){
> text=text.substring(0,size);
> f.setText(text);
> }
> }
> private void cancleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancleActionPerformed
> // Add your handling code here:
> setVisible(false);
> dispose();
> }//GEN-LAST:event_cancleActionPerformed
>
> private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
> // Add your handling code here:
> this.m_bOkay=true;
> m_oPhoneCall.setPhoneCall( nameJTextField.getText(), phoneJTextField.getText(), phone2JTextField.getText(),"", jComboBoxFor.getSelectedItem().toString() ,jTextFieldNotes.getText(),priComboBox.getSelectedItem().toS tring(),statusjComboBox.getSelectedItem().toString(),m_oDB);
> setVisible(false);
> }//GEN-LAST:event_jButtonOkActionPerformed
>
> private void statusjComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_statusjComboBoxActionPerformed
> // Add your handling code here:
> }//GEN-LAST:event_statusjComboBoxActionPerformed
>
> /** Closes the dialog */
> private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
> setVisible(false);
> dispose();
> }//GEN-LAST:event_closeDialog
>
> /**
> * @param args the command line arguments
> */
> public static void main(String args[]) {
> //new AddCallDLG (new javax.swing.JFrame (), true).show ();
> }
>
> public void setPriList(String [] p_saList) {
> for(int i=0;i<p_saList.length;i++){
> this.priComboBox.addItem(makeObj(p_saList[i]));
>
> }
> }
>
> public void setStatusList(String [] p_saList) {
> for(int i=0;i<p_saList.length;i++){
> this.statusjComboBox.addItem(makeObj(p_saList[i]));
> }
> }
>
>
> public void setCallerListName(String name){
> int inx=this.jComboBoxFor.getItemCount()-1;
> while (inx>0 && ((String)this.jComboBoxFor.getItemAt(inx)).equalsIgnoreCase( name)== false){
> inx--;
> }
> this.jComboBoxFor.setSelectedIndex(inx);
> }
>
> public void setCallerList(ArrayList p_saList) {
> for(int i=0;i<p_saList.size();i++){
> this.jComboBoxFor.addItem(p_saList.get(i));
> }
> }
>
> public PhoneCall getPhoneCall(){
> //public PhoneCall(String p_sCaller, String p_sPhone, String p_sPhone2, String p_sQedBy, String p_sFor, String p_sNotes, String p_sPri,String p_sStatus)
> PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(), "",(String)jComboBoxFor.getSelectedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
> return (pcall);
> }
> public PhoneCall getPhoneCall(String UserID){
> PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(),UserID,(String)jComboBoxFor.getS electedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
> return (pcall);
> }
>
> private Object makeObj(final String item) {
> return new Object() { public String toString() { return item; } };
> }
>
> public void setCustInfo(String name, String phone, String phone2, String accountno){
> nameJTextField.setText(name);
> phoneJTextField.setText(phone);
> m_phone=phone;
> phone2JTextField.setText(phone2);
> m_phone2=phone2;
> this.m_sAccountNO=accountno;
> if(this.m_oPhoneCall.isFirstCall(m_oDB,name)){
> System.err.println("FirstCall");
> this.jTextFieldNotes.setText("First Call:");
> this.m_bfcall=true;
> } else System.err.println("not F call");
> }
>
> public void setCallList(javax.swing.JList p_list){
> m_oCallList=p_list;
> }
>
> // Variables declaration - do not modify//GEN-BEGIN:variables
> private javax.swing.JLabel jLabel4;
> private javax.swing.JTextField phone2JTextField;
> private javax.swing.JLabel jLabel1;
> private javax.swing.JLabel jLabel3;
> private javax.swing.JTextField phoneJTextField;
> private javax.swing.JLabel jLabel2;
> private javax.swing.JLabel prijLabel;
> private javax.swing.JComboBox statusjComboBox;
> private javax.swing.JButton cancle;
> private javax.swing.JTextField jTextFieldNotes;
> private javax.swing.JButton jButtonOk;
> private javax.swing.JTextField nameJTextField;
> private javax.swing.JButton jButtionJSwitch;
> private javax.swing.JComboBox priComboBox;
> private javax.swing.JComboBox jComboBoxFor;
> private javax.swing.JLabel forjLabel;
> private javax.swing.JLabel jLabel5;
> // End of variables declaration//GEN-END:variables
>
> }




--------------010807050909080305090803
Content-Type: text/java;
name="AddCallDLG.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="AddCallDLG.java"

/*
* AddCallDLG.java
*
* Created on July 16, 2001, 1:57 PM
*/


/**
*
* @author david
* @version
*/
/* Todo
* Make it so you pass a Phone call to the dialog and it fills it in fo you.
*
**/
import javax.swing.JComboBox;
import java.util.ArrayList;

public class AddCallDLG extends javax.swing.JDialog {
private ErrorLogging m_oErrLog;
private int i_switch=0;
String m_sAccountNO;
private String m_phone, m_phone2;
boolean m_bOkay=false;
private boolean m_bfcall=false;
javax.swing.JList m_oCallList;
private PhoneCall m_oPhoneCall;
private MyDataBase m_oDB;
/** Creates new form AddCallDLG */

public AddCallDLG(PhoneMainFrame parent,boolean modal,PhoneCall p_phone,ErrorLogging errorlog) {
super(parent, modal);
//PhoneMainFrame mf = (PhoneMainFrame) parent;
m_oDB=parent.o_SqlConnection;
m_oErrLog=errorlog;
m_oPhoneCall=p_phone;
initComponents();
pack();
}

public int getStatusData(String name){
int retval=0;
try{
java.sql.Statement stmt = m_oDB.m_sqlConnection.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("Select * FROM phonegroups WHERE pgroup = '"+name+"'");
PhoneUser t_phoneuser=null;
//create an ArrayList of PhoneCalls
if (rs.next()){
retval=1;
}
else {
rs = stmt.executeQuery("Select * FROM phoneusers WHERE username= '"+name+"'");
//create an ArrayList of PhoneCalls
if (rs.next()){
t_phoneuser = new PhoneUser(m_oDB,rs);
retval=t_phoneuser.getUserStatus();
}

}
} catch (Exception ex){
// TODO Add more errorchecking code here.
System.err.println(ex.toString());

}
return retval;
}
/** 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 FormEditor.
*/
private void initComponents() {//GEN-BEGIN:initComponents
// java.awt.GridBagConstraints gridBagConstraints; VE requires distinct constraints

jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
nameJTextField = new javax.swing.JTextField();
phoneJTextField = new javax.swing.JTextField();
phone2JTextField = new javax.swing.JTextField();
statusjComboBox = new javax.swing.JComboBox();
jTextFieldNotes = new javax.swing.JTextField();
jButtonOk = new javax.swing.JButton();
cancle = new javax.swing.JButton();
prijLabel = new javax.swing.JLabel();
priComboBox = new javax.swing.JComboBox();
forjLabel = new javax.swing.JLabel();
jComboBoxFor = new javax.swing.JComboBox();
jButtionJSwitch = new javax.swing.JButton();

jDialogContentPane = new javax.swing.JPanel() ; // Explicit content pane
setContentPane(jDialogContentPane);
jDialogContentPane.setLayout(new java.awt.GridBagLayout());

setTitle("Add a Call");
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}
});

addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
closeDialog(evt);
}
});

jLabel1.setDisplayedMnemonic('N');
jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel1.setLabelFor(nameJTextField);
jLabel1.setText("Name");
java.awt.GridBagConstraints l1gridBagConstraints = new java.awt.GridBagConstraints();
l1gridBagConstraints.gridx = 0;
l1gridBagConstraints.gridy = 0;
l1gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
l1gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(jLabel1, l1gridBagConstraints);

jLabel2.setDisplayedMnemonic('P');
jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel2.setLabelFor(phoneJTextField);
jLabel2.setText("Phone");
java.awt.GridBagConstraints l2gridBagConstraints = new java.awt.GridBagConstraints();
l2gridBagConstraints.gridx = 0;
l2gridBagConstraints.gridy = 1;
l2gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
l2gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(jLabel2, l2gridBagConstraints);

jLabel3.setDisplayedMnemonic('2');
jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel3.setLabelFor(phone2JTextField);
jLabel3.setText("Phone2");
java.awt.GridBagConstraints l3gridBagConstraints = new java.awt.GridBagConstraints();
l3gridBagConstraints.gridx = 0;
l3gridBagConstraints.gridy = 2;
l3gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
l3gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(jLabel3, l3gridBagConstraints);

jLabel4.setDisplayedMnemonic('a');
jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel4.setLabelFor(statusjComboBox);
jLabel4.setText("Status");
java.awt.GridBagConstraints l4gridBagConstraints = new java.awt.GridBagConstraints();
l4gridBagConstraints.gridx = 0;
l4gridBagConstraints.gridy = 3;
l4gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
l4gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(jLabel4, l4gridBagConstraints);

jLabel5.setDisplayedMnemonic('t');
jLabel5.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel5.setLabelFor(jTextFieldNotes);
jLabel5.setText("Note");
java.awt.GridBagConstraints l5gridBagConstraints = new java.awt.GridBagConstraints();
l5gridBagConstraints.gridx = 0;
l5gridBagConstraints.gridy = 5;
l5gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
l5gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(jLabel5, l5gridBagConstraints);

nameJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
nameJTextFieldFocusGained(evt);
}
});

nameJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
nameJTextFieldKeyTyped(evt);
}
});

java.awt.GridBagConstraints ntfgridBagConstraints = new java.awt.GridBagConstraints();
ntfgridBagConstraints.gridx = 1;
ntfgridBagConstraints.gridy = 0;
ntfgridBagConstraints.gridwidth = 5;
ntfgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
ntfgridBagConstraints.ipadx = 396;
ntfgridBagConstraints.ipady = 10;
ntfgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
jDialogContentPane.add(nameJTextField, ntfgridBagConstraints);

phoneJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
phoneJTextFieldFocusGained(evt);
}
});

phoneJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
phoneJTextFieldKeyTyped(evt);
}
});

java.awt.GridBagConstraints ptfgridBagConstraints = new java.awt.GridBagConstraints();
ptfgridBagConstraints.gridx = 1;
ptfgridBagConstraints.gridy = 1;
ptfgridBagConstraints.gridwidth = 4;
ptfgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
ptfgridBagConstraints.ipadx = 396;
ptfgridBagConstraints.ipady = 10;
ptfgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
jDialogContentPane.add(phoneJTextField, ptfgridBagConstraints);

phone2JTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
phone2JTextFieldFocusGained(evt);
}
});

phone2JTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
phone2JTextFieldKeyTyped(evt);
}
});

java.awt.GridBagConstraints ptf2gridBagConstraints = new java.awt.GridBagConstraints();
ptf2gridBagConstraints.gridx = 1;
ptf2gridBagConstraints.gridy = 2;
ptf2gridBagConstraints.gridwidth = 4;
ptf2gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
ptf2gridBagConstraints.ipadx = 396;
ptf2gridBagConstraints.ipady = 10;
ptf2gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
jDialogContentPane.add(phone2JTextField, ptf2gridBagConstraints);

statusjComboBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
statusjComboBoxActionPerformed(evt);
}
});

statusjComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
statusjComboBoxMouseWheelMoved(evt);
}
});

java.awt.GridBagConstraints statgridBagConstraints = new java.awt.GridBagConstraints();
statgridBagConstraints.gridx = 1;
statgridBagConstraints.gridy = 3;
statgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
statgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
jDialogContentPane.add(statusjComboBox, statgridBagConstraints);

jTextFieldNotes.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextFieldNotesFocusGained(evt);
}
});

jTextFieldNotes.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jTextFieldNotesKeyTyped(evt);
}
});

java.awt.GridBagConstraints ngridBagConstraints = new java.awt.GridBagConstraints();
ngridBagConstraints.gridx = 1;
ngridBagConstraints.gridy = 5;
ngridBagConstraints.gridwidth = 5;
ngridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
ngridBagConstraints.ipadx = 500;
ngridBagConstraints.ipady = 10;
ngridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
jDialogContentPane.add(jTextFieldNotes, ngridBagConstraints);

jButtonOk.setMnemonic('O');
jButtonOk.setText("Ok");
jButtonOk.setSelected(true);
jButtonOk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonOkActionPerformed(evt);
}
});

java.awt.GridBagConstraints okgridBagConstraints = new java.awt.GridBagConstraints();
okgridBagConstraints.gridx = 1;
okgridBagConstraints.gridy = 6;
okgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
okgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
jDialogContentPane.add(jButtonOk, okgridBagConstraints);

cancle.setMnemonic('C');
cancle.setText("Cancel");
cancle.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancleActionPerformed(evt);
}
});

java.awt.GridBagConstraints cancelgridBagConstraints = new java.awt.GridBagConstraints();
cancelgridBagConstraints.gridx = 5;
cancelgridBagConstraints.gridy = 6;
cancelgridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
cancelgridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
cancelgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
jDialogContentPane.add(cancle, cancelgridBagConstraints);

prijLabel.setDisplayedMnemonic('r');
prijLabel.setFont(new java.awt.Font("Dialog", 0, 14));
prijLabel.setLabelFor(priComboBox);
prijLabel.setText("Priority ");
prijLabel.setName("Add Call");
java.awt.GridBagConstraints prigridBagConstraints = new java.awt.GridBagConstraints();
prigridBagConstraints.gridx = 2;
prigridBagConstraints.gridy = 3;
prigridBagConstraints.gridwidth = 2;
prigridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
jDialogContentPane.add(prijLabel, prigridBagConstraints);

priComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
priComboBoxMouseWheelMoved(evt);
}
});

java.awt.GridBagConstraints pricbgridBagConstraints = new java.awt.GridBagConstraints();
pricbgridBagConstraints.gridx = 4;
pricbgridBagConstraints.gridy = 3;
pricbgridBagConstraints.gridwidth = 2;
pricbgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
pricbgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
jDialogContentPane.add(priComboBox, pricbgridBagConstraints);

forjLabel.setDisplayedMnemonic('F');
forjLabel.setFont(new java.awt.Font("Dialog", 0, 14));
forjLabel.setLabelFor(jComboBoxFor);
forjLabel.setText("For");
java.awt.GridBagConstraints lgridBagConstraints = new java.awt.GridBagConstraints();
lgridBagConstraints.gridx = 0;
lgridBagConstraints.gridy = 4;
lgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
lgridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(forjLabel, lgridBagConstraints);

jComboBoxFor.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(java.awt.event.MouseEvent evt) {
jComboBoxForMouseReleased(evt);
}
});

jComboBoxFor.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
jComboBoxForMouseWheelMoved(evt);
}
});

jComboBoxFor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
jComboBoxForPropertyChange(evt);
}
});

java.awt.GridBagConstraints forgridBagConstraints = new java.awt.GridBagConstraints();
forgridBagConstraints.gridx = 1;
forgridBagConstraints.gridy = 4;
forgridBagConstraints.gridwidth = 5;
forgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
forgridBagConstraints.ipadx = 260;
forgridBagConstraints.ipady = 5;
forgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
jDialogContentPane.add(jComboBoxFor, forgridBagConstraints);

jButtionJSwitch.setMnemonic('S');
jButtionJSwitch.setText("Switch");
jButtionJSwitch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtionJSwitchActionPerformed(evt);
}
});

java.awt.GridBagConstraints sgridBagConstraints = new java.awt.GridBagConstraints();
sgridBagConstraints.gridx = 5;
sgridBagConstraints.gridy = 1;
sgridBagConstraints.gridheight = 2;
sgridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
sgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
jDialogContentPane.add(jButtionJSwitch, sgridBagConstraints);

}//GEN-END:initComponents

private void jTextFieldNotesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldNotesFocusGained
// Add your handling code here:
if(this.m_bfcall){
this.jTextFieldNotes.setCaretPosition(this.jTextFieldNotes.g etText().length());
} else this.setSelectTextAll(this.jTextFieldNotes);
}//GEN-LAST:event_jTextFieldNotesFocusGained

private void phone2JTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phone2JTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.phone2JTextField);
}//GEN-LAST:event_phone2JTextFieldFocusGained

private void nameJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_nameJTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.nameJTextField);
}//GEN-LAST:event_nameJTextFieldFocusGained

private void phoneJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phoneJTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.phoneJTextField);
}//GEN-LAST:event_phoneJTextFieldFocusGained
private static void setSelectTextAll(javax.swing.JTextField textField){
textField.setSelectionStart(0);
textField.setSelectionEnd(textField.getText().length());
}
private void jComboBoxForMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_jComboBoxForMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.jComboBoxFor);
}//GEN-LAST:event_jComboBoxForMouseWheelMoved

private void statusjComboBoxMouseWheelMoved(java.awt.event.MouseWheelEven t evt) {//GEN-FIRST:event_statusjComboBoxMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.statusjComboBox);
}//GEN-LAST:event_statusjComboBoxMouseWheelMoved

private void scrollWheelComboBox(java.awt.event.MouseWheelEvent evt, javax.swing.JComboBox cBox){
int i_inc = +1;
if(evt.getWheelRotation()<0) {i_inc=-1;}
int pos=cBox.getSelectedIndex()+i_inc;
if(pos>=cBox.getItemCount()) pos=0;
if(pos<0) pos=cBox.getItemCount()-1;
cBox.setSelectedIndex(pos);
}
private void priComboBoxMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_priComboBoxMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.priComboBox);
}//GEN-LAST:event_priComboBoxMouseWheelMoved

private void jComboBoxForMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxForMouseReleased
// Add your handling code here:
String user =(String)this.jComboBoxFor.getSelectedItem();
if (user!=null) if (getStatusData(user)==0){
System.err.println("not On Phone");
}
}//GEN-LAST:event_jComboBoxForMouseReleased

private void jComboBoxForPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jComboBoxForPropertyChange
// Add your handling code here:
String user =(String)this.jComboBoxFor.getSelectedItem();
if (user!=null) if (getStatusData(user)==0){
new NotHereDLG(new javax.swing.JFrame(), true,user).show();
}
}//GEN-LAST:event_jComboBoxForPropertyChange

private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
// Add your handling code here:
checkTextFieldLen(jTextFieldNotes,3998);
checkTextFieldLen(phone2JTextField,39);
checkTextFieldLen(phoneJTextField,39);
checkTextFieldLen(nameJTextField,79);
if(this.m_bfcall){
this.priComboBox.setSelectedIndex(1);
javax.swing.JOptionPane.showMessageDialog(this,"First Call");
}
}//GEN-LAST:event_formComponentShown

private void jTextFieldNotesKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldNotesKeyTyped
// Add your handling code here:
checkTextFieldLen(jTextFieldNotes,3998);
}//GEN-LAST:event_jTextFieldNotesKeyTyped

private void phone2JTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phone2JTextFieldKeyTyped
// Add your handling code here:
checkTextFieldLen(phone2JTextField,39);
}//GEN-LAST:event_phone2JTextFieldKeyTyped

private void phoneJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phoneJTextFieldKeyTyped
checkTextFieldLen(phoneJTextField,39);
// Add your handling code here:
}//GEN-LAST:event_phoneJTextFieldKeyTyped

private void nameJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nameJTextFieldKeyTyped
// Add your handling code here:
checkTextFieldLen(nameJTextField,79);
}//GEN-LAST:event_nameJTextFieldKeyTyped

private void jButtionJSwitchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtionJSwitchActionPerformed
// Add your handling code here:
switch(i_switch){
case 0:
i_switch++;
phoneJTextField.setText(m_phone2);
phone2JTextField.setText(m_phone);
break;
case 1:
i_switch++;
phoneJTextField.setText("");
phone2JTextField.setText(m_phone);
phoneJTextField.requestFocus();
break;
default :
i_switch=0;
phoneJTextField.setText(m_phone);
phone2JTextField.setText(m_phone2);
}
}//GEN-LAST:event_jButtionJSwitchActionPerformed
private void checkTextFieldLen(javax.swing.JTextField f, int size){
String text= f.getText();
if(text.length()>size){
text=text.substring(0,size);
f.setText(text);
}
}
private void cancleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancleActionPerformed
// Add your handling code here:
setVisible(false);
dispose();
}//GEN-LAST:event_cancleActionPerformed

private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
// Add your handling code here:
this.m_bOkay=true;
m_oPhoneCall.setPhoneCall( nameJTextField.getText(), phoneJTextField.getText(), phone2JTextField.getText(),"", jComboBoxFor.getSelectedItem().toString() ,jTextFieldNotes.getText(),priComboBox.getSelectedItem().toS tring(),statusjComboBox.getSelectedItem().toString(),m_oDB);
setVisible(false);
}//GEN-LAST:event_jButtonOkActionPerformed

private void statusjComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_statusjComboBoxActionPerformed
// Add your handling code here:
}//GEN-LAST:event_statusjComboBoxActionPerformed

/** Closes the dialog */
private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
setVisible(false);
dispose();
}//GEN-LAST:event_closeDialog

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
//new AddCallDLG (new javax.swing.JFrame (), true).show ();
}

public void setPriList(String [] p_saList) {
for(int i=0;i<p_saList.length;i++){
this.priComboBox.addItem(makeObj(p_saList[i]));

}
}

public void setStatusList(String [] p_saList) {
for(int i=0;i<p_saList.length;i++){
this.statusjComboBox.addItem(makeObj(p_saList[i]));
}
}


public void setCallerListName(String name){
int inx=this.jComboBoxFor.getItemCount()-1;
while (inx>0 && ((String)this.jComboBoxFor.getItemAt(inx)).equalsIgnoreCase( name)== false){
inx--;
}
this.jComboBoxFor.setSelectedIndex(inx);
}

public void setCallerList(ArrayList p_saList) {
for(int i=0;i<p_saList.size();i++){
this.jComboBoxFor.addItem(p_saList.get(i));
}
}

public PhoneCall getPhoneCall(){
//public PhoneCall(String p_sCaller, String p_sPhone, String p_sPhone2, String p_sQedBy, String p_sFor, String p_sNotes, String p_sPri,String p_sStatus)
PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(), "",(String)jComboBoxFor.getSelectedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
return (pcall);
}
public PhoneCall getPhoneCall(String UserID){
PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField..getText(),UserID,(String)jComboBoxFor.get SelectedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
return (pcall);
}

private Object makeObj(final String item) {
return new Object() { public String toString() { return item; } };
}

public void setCustInfo(String name, String phone, String phone2, String accountno){
nameJTextField.setText(name);
phoneJTextField.setText(phone);
m_phone=phone;
phone2JTextField.setText(phone2);
m_phone2=phone2;
this.m_sAccountNO=accountno;
if(this.m_oPhoneCall.isFirstCall(m_oDB,name)){
System.err.println("FirstCall");
this.jTextFieldNotes.setText("First Call:");
this.m_bfcall=true;
} else System.err.println("not F call");
}

public void setCallList(javax.swing.JList p_list){
m_oCallList=p_list;
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField phone2JTextField;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField phoneJTextField;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel prijLabel;
private javax.swing.JComboBox statusjComboBox;
private javax.swing.JButton cancle;
private javax.swing.JTextField jTextFieldNotes;
private javax.swing.JButton jButtonOk;
private javax.swing.JTextField nameJTextField;
private javax.swing.JButton jButtionJSwitch;
private javax.swing.JComboBox priComboBox;
private javax.swing.JComboBox jComboBoxFor;
private javax.swing.JLabel forjLabel;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jDialogContentPane; // VE does not support implicit components at this time
// End of variables declaration//GEN-END:variables

}
--------------010807050909080305090803
Content-Type: image/jpeg;
name="dialog.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="dialog.jpg"

/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcH Bw8LCwkMEQ8S
EhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcG Bw4ICA4eFBEU
Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e Hh4eHh7/wAAR
CAJXAz4DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcI CQoL/8QAtRAA
AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJ
Re: VE importing NetBeans [message #8977 is a reply to message #8516] Mon, 08 December 2003 16:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david.eclipsecat.com

Gili Mendel wrote:
> There are two pattern issues that inhibits VE to parse this code properly:
>
> 1. implicit content pane. VE requires (in this version) to explicitly
> declare a content pane.
>
> 2. When using GridBag constraints, you will have to declare a unique
> constraint for each component you are adding ... the code above reuse
> the same variable (yet still allocate a new one).
>
> I modified the code by hand, so that you can diff the files. Note that
> there are many compile errors in the file, as this code reference
> classes that are not available. The beauty of VE is that compile errors
> that are not relevant are ignored.
>
> David Siebert wrote:
>
>> Here is the file I tried to export.
>> So far I find Eclipse to be pretty good. The Perl plugin seems to work
>> well. VE seems like it is a pretty nice piece of work but I have only
>> really just started to play with Eclipse. I have added two new
>> features to one of my programs today so I would say I am off to a good
>> start.
>>
>>
>> ------------------------------------------------------------ ------------
>>
>> /*
>> * AddCallDLG.java
>> *
>> * Created on July 16, 2001, 1:57 PM
>> */
>>
>>
>> /**
>> *
>> * @author david
>> * @version
>> */
>> /* Todo
>> * Make it so you pass a Phone call to the dialog and it fills it in
>> fo you.
>> *
>> **/
>> import javax.swing.JComboBox;
>> import java.util.ArrayList;
>>
>> public class AddCallDLG extends javax.swing.JDialog {
>> private ErrorLogging m_oErrLog;
>> private int i_switch=0;
>> String m_sAccountNO;
>> private String m_phone, m_phone2;
>> boolean m_bOkay=false;
>> private boolean m_bfcall=false;
>> javax.swing.JList m_oCallList;
>> private PhoneCall m_oPhoneCall;
>> private MyDataBase m_oDB;
>> /** Creates new form AddCallDLG */
>> public AddCallDLG(PhoneMainFrame parent,boolean
>> modal,PhoneCall p_phone,ErrorLogging errorlog) {
>> super(parent, modal);
>> //PhoneMainFrame mf = (PhoneMainFrame) parent;
>> m_oDB=parent.o_SqlConnection;
>> m_oErrLog=errorlog;
>> m_oPhoneCall=p_phone;
>> initComponents();
>> pack();
>> }
>> public int getStatusData(String name){
>> int retval=0;
>> try{
>> java.sql.Statement stmt =
>> m_oDB.m_sqlConnection.createStatement();
>> java.sql.ResultSet rs = stmt.executeQuery("Select * FROM
>> phonegroups WHERE pgroup = '"+name+"'");
>> PhoneUser t_phoneuser=null;
>> //create an ArrayList of PhoneCalls
>> if (rs.next()){
>> retval=1;
>> }
>> else {
>> rs = stmt.executeQuery("Select * FROM phoneusers WHERE
>> username= '"+name+"'");
>> //create an ArrayList of PhoneCalls
>> if (rs.next()){
>> t_phoneuser = new PhoneUser(m_oDB,rs);
>> retval=t_phoneuser.getUserStatus();
>> }
>> }
>> } catch (Exception ex){
>> // TODO Add more errorchecking code here.
>> System.err.println(ex.toString());
>> }
>> return retval;
>> }
>> /** 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 FormEditor.
>> */
>> private void initComponents() {//GEN-BEGIN:initComponents
>> java.awt.GridBagConstraints gridBagConstraints;
>>
>> jLabel1 = new javax.swing.JLabel();
>> jLabel2 = new javax.swing.JLabel();
>> jLabel3 = new javax.swing.JLabel();
>> jLabel4 = new javax.swing.JLabel();
>> jLabel5 = new javax.swing.JLabel();
>> nameJTextField = new javax.swing.JTextField();
>> phoneJTextField = new javax.swing.JTextField();
>> phone2JTextField = new javax.swing.JTextField();
>> statusjComboBox = new javax.swing.JComboBox();
>> jTextFieldNotes = new javax.swing.JTextField();
>> jButtonOk = new javax.swing.JButton();
>> cancle = new javax.swing.JButton();
>> prijLabel = new javax.swing.JLabel();
>> priComboBox = new javax.swing.JComboBox();
>> forjLabel = new javax.swing.JLabel();
>> jComboBoxFor = new javax.swing.JComboBox();
>> jButtionJSwitch = new javax.swing.JButton();
>>
>> getContentPane().setLayout(new java.awt.GridBagLayout());
>>
>> setTitle("Add a Call");
>> addComponentListener(new java.awt.event.ComponentAdapter() {
>> public void componentShown(java.awt.event.ComponentEvent
>> evt) {
>> formComponentShown(evt);
>> }
>> });
>>
>> addWindowListener(new java.awt.event.WindowAdapter() {
>> public void windowClosing(java.awt.event.WindowEvent evt) {
>> closeDialog(evt);
>> }
>> });
>>
>> jLabel1.setDisplayedMnemonic('N');
>> jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
>> jLabel1.setLabelFor(nameJTextField);
>> jLabel1.setText("Name");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 0;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(jLabel1, gridBagConstraints);
>>
>> jLabel2.setDisplayedMnemonic('P');
>> jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));
>> jLabel2.setLabelFor(phoneJTextField);
>> jLabel2.setText("Phone");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 1;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(jLabel2, gridBagConstraints);
>>
>> jLabel3.setDisplayedMnemonic('2');
>> jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));
>> jLabel3.setLabelFor(phone2JTextField);
>> jLabel3.setText("Phone2");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 2;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(jLabel3, gridBagConstraints);
>>
>> jLabel4.setDisplayedMnemonic('a');
>> jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));
>> jLabel4.setLabelFor(statusjComboBox);
>> jLabel4.setText("Status");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 3;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(jLabel4, gridBagConstraints);
>>
>> jLabel5.setDisplayedMnemonic('t');
>> jLabel5.setFont(new java.awt.Font("Dialog", 0, 14));
>> jLabel5.setLabelFor(jTextFieldNotes);
>> jLabel5.setText("Note");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 5;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(jLabel5, gridBagConstraints);
>>
>> nameJTextField.addFocusListener(new
>> java.awt.event.FocusAdapter() {
>> public void focusGained(java.awt.event.FocusEvent evt) {
>> nameJTextFieldFocusGained(evt);
>> }
>> });
>>
>> nameJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
>> public void keyTyped(java.awt.event.KeyEvent evt) {
>> nameJTextFieldKeyTyped(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 0;
>> gridBagConstraints.gridwidth = 5;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.ipadx = 396;
>> gridBagConstraints.ipady = 10;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
>> getContentPane().add(nameJTextField, gridBagConstraints);
>>
>> phoneJTextField.addFocusListener(new
>> java.awt.event.FocusAdapter() {
>> public void focusGained(java.awt.event.FocusEvent evt) {
>> phoneJTextFieldFocusGained(evt);
>> }
>> });
>>
>> phoneJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
>> public void keyTyped(java.awt.event.KeyEvent evt) {
>> phoneJTextFieldKeyTyped(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 1;
>> gridBagConstraints.gridwidth = 4;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.ipadx = 396;
>> gridBagConstraints.ipady = 10;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
>> getContentPane().add(phoneJTextField, gridBagConstraints);
>>
>> phone2JTextField.addFocusListener(new
>> java.awt.event.FocusAdapter() {
>> public void focusGained(java.awt.event.FocusEvent evt) {
>> phone2JTextFieldFocusGained(evt);
>> }
>> });
>>
>> phone2JTextField.addKeyListener(new java.awt.event.KeyAdapter() {
>> public void keyTyped(java.awt.event.KeyEvent evt) {
>> phone2JTextFieldKeyTyped(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 2;
>> gridBagConstraints.gridwidth = 4;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.ipadx = 396;
>> gridBagConstraints.ipady = 10;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
>> getContentPane().add(phone2JTextField, gridBagConstraints);
>>
>> statusjComboBox.addActionListener(new
>> java.awt.event.ActionListener() {
>> public void actionPerformed(java.awt.event.ActionEvent evt) {
>> statusjComboBoxActionPerformed(evt);
>> }
>> });
>>
>> statusjComboBox.addMouseWheelListener(new
>> java.awt.event.MouseWheelListener() {
>> public void mouseWheelMoved(java.awt.event.MouseWheelEvent
>> evt) {
>> statusjComboBoxMouseWheelMoved(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 3;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
>> getContentPane().add(statusjComboBox, gridBagConstraints);
>>
>> jTextFieldNotes.addFocusListener(new
>> java.awt.event.FocusAdapter() {
>> public void focusGained(java.awt.event.FocusEvent evt) {
>> jTextFieldNotesFocusGained(evt);
>> }
>> });
>>
>> jTextFieldNotes.addKeyListener(new java.awt.event.KeyAdapter() {
>> public void keyTyped(java.awt.event.KeyEvent evt) {
>> jTextFieldNotesKeyTyped(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 5;
>> gridBagConstraints.gridwidth = 5;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.ipadx = 500;
>> gridBagConstraints.ipady = 10;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
>> getContentPane().add(jTextFieldNotes, gridBagConstraints);
>>
>> jButtonOk.setMnemonic('O');
>> jButtonOk.setText("Ok");
>> jButtonOk.setSelected(true);
>> jButtonOk.addActionListener(new java.awt.event.ActionListener() {
>> public void actionPerformed(java.awt.event.ActionEvent evt) {
>> jButtonOkActionPerformed(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 6;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
>> getContentPane().add(jButtonOk, gridBagConstraints);
>>
>> cancle.setMnemonic('C');
>> cancle.setText("Cancel");
>> cancle.addActionListener(new java.awt.event.ActionListener() {
>> public void actionPerformed(java.awt.event.ActionEvent evt) {
>> cancleActionPerformed(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 5;
>> gridBagConstraints.gridy = 6;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
>> gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
>> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
>> getContentPane().add(cancle, gridBagConstraints);
>>
>> prijLabel.setDisplayedMnemonic('r');
>> prijLabel.setFont(new java.awt.Font("Dialog", 0, 14));
>> prijLabel.setLabelFor(priComboBox);
>> prijLabel.setText("Priority ");
>> prijLabel.setName("Add Call");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 2;
>> gridBagConstraints.gridy = 3;
>> gridBagConstraints.gridwidth = 2;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> getContentPane().add(prijLabel, gridBagConstraints);
>>
>> priComboBox.addMouseWheelListener(new
>> java.awt.event.MouseWheelListener() {
>> public void mouseWheelMoved(java.awt.event.MouseWheelEvent
>> evt) {
>> priComboBoxMouseWheelMoved(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 4;
>> gridBagConstraints.gridy = 3;
>> gridBagConstraints.gridwidth = 2;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
>> getContentPane().add(priComboBox, gridBagConstraints);
>>
>> forjLabel.setDisplayedMnemonic('F');
>> forjLabel.setFont(new java.awt.Font("Dialog", 0, 14));
>> forjLabel.setLabelFor(jComboBoxFor);
>> forjLabel.setText("For");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 4;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(forjLabel, gridBagConstraints);
>>
>> jComboBoxFor.addMouseListener(new java.awt.event.MouseAdapter() {
>> public void mouseReleased(java.awt.event.MouseEvent evt) {
>> jComboBoxForMouseReleased(evt);
>> }
>> });
>>
>> jComboBoxFor.addMouseWheelListener(new
>> java.awt.event.MouseWheelListener() {
>> public void mouseWheelMoved(java.awt.event.MouseWheelEvent
>> evt) {
>> jComboBoxForMouseWheelMoved(evt);
>> }
>> });
>>
>> jComboBoxFor.addPropertyChangeListener(new
>> java.beans.PropertyChangeListener() {
>> public void propertyChange(java.beans.PropertyChangeEvent
>> evt) {
>> jComboBoxForPropertyChange(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 4;
>> gridBagConstraints.gridwidth = 5;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.ipadx = 260;
>> gridBagConstraints.ipady = 5;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
>> getContentPane().add(jComboBoxFor, gridBagConstraints);
>>
>> jButtionJSwitch.setMnemonic('S');
>> jButtionJSwitch.setText("Switch");
>> jButtionJSwitch.addActionListener(new
>> java.awt.event.ActionListener() {
>> public void actionPerformed(java.awt.event.ActionEvent evt) {
>> jButtionJSwitchActionPerformed(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 5;
>> gridBagConstraints.gridy = 1;
>> gridBagConstraints.gridheight = 2;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
>> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
>> getContentPane().add(jButtionJSwitch, gridBagConstraints);
>>
>> }//GEN-END:initComponents
>> private void
>> jTextFieldNotesFocusGained(java.awt.event.FocusEvent evt)
>> {//GEN-FIRST:event_jTextFieldNotesFocusGained
>> // Add your handling code here:
>> if(this.m_bfcall){
>>
>> this.jTextFieldNotes.setCaretPosition(this.jTextFieldNotes.g etText().length());
>>
>> } else this.setSelectTextAll(this.jTextFieldNotes);
>> }//GEN-LAST:event_jTextFieldNotesFocusGained
>> private void
>> phone2JTextFieldFocusGained(java.awt.event.FocusEvent evt)
>> {//GEN-FIRST:event_phone2JTextFieldFocusGained
>> // Add your handling code here:
>> this.setSelectTextAll(this.phone2JTextField);
>> }//GEN-LAST:event_phone2JTextFieldFocusGained
>> private void
>> nameJTextFieldFocusGained(java.awt.event.FocusEvent evt)
>> {//GEN-FIRST:event_nameJTextFieldFocusGained
>> // Add your handling code here:
>> this.setSelectTextAll(this.nameJTextField);
>> }//GEN-LAST:event_nameJTextFieldFocusGained
>> private void
>> phoneJTextFieldFocusGained(java.awt.event.FocusEvent evt)
>> {//GEN-FIRST:event_phoneJTextFieldFocusGained
>> // Add your handling code here:
>> this.setSelectTextAll(this.phoneJTextField);
>> }//GEN-LAST:event_phoneJTextFieldFocusGained
>> private static void setSelectTextAll(javax.swing.JTextField
>> textField){
>> textField.setSelectionStart(0);
>> textField.setSelectionEnd(textField.getText().length());
>> }
>> private void
>> jComboBoxForMouseWheelMoved(java.awt.event.MouseWheelEvent evt)
>> {//GEN-FIRST:event_jComboBoxForMouseWheelMoved
>> // Add your handling code here:
>> this.scrollWheelComboBox(evt, this.jComboBoxFor);
>> }//GEN-LAST:event_jComboBoxForMouseWheelMoved
>> private void
>> statusjComboBoxMouseWheelMoved(java.awt.event.MouseWheelEven t evt)
>> {//GEN-FIRST:event_statusjComboBoxMouseWheelMoved
>> // Add your handling code here:
>> this.scrollWheelComboBox(evt, this.statusjComboBox);
>> }//GEN-LAST:event_statusjComboBoxMouseWheelMoved
>> private void
>> scrollWheelComboBox(java.awt.event.MouseWheelEvent evt,
>> javax.swing.JComboBox cBox){
>> int i_inc = +1;
>> if(evt.getWheelRotation()<0) {i_inc=-1;}
>> int pos=cBox.getSelectedIndex()+i_inc;
>> if(pos>=cBox.getItemCount()) pos=0;
>> if(pos<0) pos=cBox.getItemCount()-1;
>> cBox.setSelectedIndex(pos);
>> }
>> private void
>> priComboBoxMouseWheelMoved(java.awt.event.MouseWheelEvent evt)
>> {//GEN-FIRST:event_priComboBoxMouseWheelMoved
>> // Add your handling code here:
>> this.scrollWheelComboBox(evt, this.priComboBox);
>> }//GEN-LAST:event_priComboBoxMouseWheelMoved
>> private void
>> jComboBoxForMouseReleased(java.awt.event.MouseEvent evt)
>> {//GEN-FIRST:event_jComboBoxForMouseReleased
>> // Add your handling code here:
>> String user =(String)this.jComboBoxFor.getSelectedItem();
>> if (user!=null) if (getStatusData(user)==0){
>> System.err.println("not On Phone");
>> }
>> }//GEN-LAST:event_jComboBoxForMouseReleased
>> private void
>> jComboBoxForPropertyChange(java.beans.PropertyChangeEvent evt)
>> {//GEN-FIRST:event_jComboBoxForPropertyChange
>> // Add your handling code here:
>> String user =(String)this.jComboBoxFor.getSelectedItem();
>> if (user!=null) if (getStatusData(user)==0){
>> new NotHereDLG(new javax.swing.JFrame(), true,user).show();
>> }
>> }//GEN-LAST:event_jComboBoxForPropertyChange
>> private void formComponentShown(java.awt.event.ComponentEvent
>> evt) {//GEN-FIRST:event_formComponentShown
>> // Add your handling code here:
>> checkTextFieldLen(jTextFieldNotes,3998);
>> checkTextFieldLen(phone2JTextField,39);
>> checkTextFieldLen(phoneJTextField,39);
>> checkTextFieldLen(nameJTextField,79);
>> if(this.m_bfcall){
>> this.priComboBox.setSelectedIndex(1);
>> javax.swing.JOptionPane.showMessageDialog(this,"First Call");
>> }
>> }//GEN-LAST:event_formComponentShown
>> private void jTextFieldNotesKeyTyped(java.awt.event.KeyEvent
>> evt) {//GEN-FIRST:event_jTextFieldNotesKeyTyped
>> // Add your handling code here:
>> checkTextFieldLen(jTextFieldNotes,3998);
>> }//GEN-LAST:event_jTextFieldNotesKeyTyped
>> private void phone2JTextFieldKeyTyped(java.awt.event.KeyEvent
>> evt) {//GEN-FIRST:event_phone2JTextFieldKeyTyped
>> // Add your handling code here:
>> checkTextFieldLen(phone2JTextField,39);
>> }//GEN-LAST:event_phone2JTextFieldKeyTyped
>> private void phoneJTextFieldKeyTyped(java.awt.event.KeyEvent
>> evt) {//GEN-FIRST:event_phoneJTextFieldKeyTyped
>> checkTextFieldLen(phoneJTextField,39);
>> // Add your handling code here:
>> }//GEN-LAST:event_phoneJTextFieldKeyTyped
>> private void nameJTextFieldKeyTyped(java.awt.event.KeyEvent
>> evt) {//GEN-FIRST:event_nameJTextFieldKeyTyped
>> // Add your handling code here:
>> checkTextFieldLen(nameJTextField,79);
>> }//GEN-LAST:event_nameJTextFieldKeyTyped
>> private void
>> jButtionJSwitchActionPerformed(java.awt.event.ActionEvent evt)
>> {//GEN-FIRST:event_jButtionJSwitchActionPerformed
>> // Add your handling code here:
>> switch(i_switch){
>> case 0:
>> i_switch++;
>> phoneJTextField.setText(m_phone2);
>> phone2JTextField.setText(m_phone);
>> break;
>> case 1:
>> i_switch++;
>> phoneJTextField.setText("");
>> phone2JTextField.setText(m_phone);
>> phoneJTextField.requestFocus();
>> break;
>> default :
>> i_switch=0;
>> phoneJTextField.setText(m_phone);
>> phone2JTextField.setText(m_phone2);
>> }
>> }//GEN-LAST:event_jButtionJSwitchActionPerformed
>> private void checkTextFieldLen(javax.swing.JTextField f, int size){
>> String text= f.getText();
>> if(text.length()>size){
>> text=text.substring(0,size);
>> f.setText(text);
>> }
>> }
>> private void cancleActionPerformed(java.awt.event.ActionEvent evt)
>> {//GEN-FIRST:event_cancleActionPerformed
>> // Add your handling code here:
>> setVisible(false);
>> dispose();
>> }//GEN-LAST:event_cancleActionPerformed
>> private void jButtonOkActionPerformed(java.awt.event.ActionEvent
>> evt) {//GEN-FIRST:event_jButtonOkActionPerformed
>> // Add your handling code here:
>> this.m_bOkay=true;
>> m_oPhoneCall.setPhoneCall( nameJTextField.getText(),
>> phoneJTextField.getText(), phone2JTextField.getText(),"",
>> jComboBoxFor.getSelectedItem().toString()
>> ,jTextFieldNotes.getText(),priComboBox.getSelectedItem().toS tring(),statusjComboBox.getSelectedItem().toString(),m_oDB);
>>
>> setVisible(false);
>> }//GEN-LAST:event_jButtonOkActionPerformed
>> private void
>> statusjComboBoxActionPerformed(java.awt.event.ActionEvent evt)
>> {//GEN-FIRST:event_statusjComboBoxActionPerformed
>> // Add your handling code here:
>> }//GEN-LAST:event_statusjComboBoxActionPerformed
>> /** Closes the dialog */
>> private void closeDialog(java.awt.event.WindowEvent evt)
>> {//GEN-FIRST:event_closeDialog
>> setVisible(false);
>> dispose();
>> }//GEN-LAST:event_closeDialog
>> /**
>> * @param args the command line arguments
>> */
>> public static void main(String args[]) {
>> //new AddCallDLG (new javax.swing.JFrame (), true).show ();
>> }
>> public void setPriList(String [] p_saList) {
>> for(int i=0;i<p_saList.length;i++){
>> this.priComboBox.addItem(makeObj(p_saList[i]));
>> }
>> }
>> public void setStatusList(String [] p_saList) {
>> for(int i=0;i<p_saList.length;i++){
>> this.statusjComboBox.addItem(makeObj(p_saList[i]));
>> }
>> }
>> public void setCallerListName(String name){
>> int inx=this.jComboBoxFor.getItemCount()-1;
>> while (inx>0 &&
>> ((String)this.jComboBoxFor.getItemAt(inx)).equalsIgnoreCase( name)==
>> false){
>> inx--;
>> }
>> this.jComboBoxFor.setSelectedIndex(inx);
>> }
>> public void setCallerList(ArrayList p_saList) {
>> for(int i=0;i<p_saList.size();i++){
>> this.jComboBoxFor.addItem(p_saList.get(i));
>> }
>> }
>> public PhoneCall getPhoneCall(){
>> //public PhoneCall(String p_sCaller, String p_sPhone, String
>> p_sPhone2, String p_sQedBy, String p_sFor, String p_sNotes, String
>> p_sPri,String p_sStatus)
>> PhoneCall pcall= new
>> PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(), "",(String)jComboBoxFor.getSelectedItem(),
>> jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
>>
>> return (pcall);
>> }
>> public PhoneCall getPhoneCall(String UserID){
>> PhoneCall pcall= new
>> PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(),UserID,(String)jComboBoxFor.getS electedItem(),
>> jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
>>
>> return (pcall);
>> }
>> private Object makeObj(final String item) {
>> return new Object() { public String toString() { return item;
>> } };
>> }
>> public void setCustInfo(String name, String phone, String
>> phone2, String accountno){
>> nameJTextField.setText(name);
>> phoneJTextField.setText(phone);
>> m_phone=phone;
>> phone2JTextField.setText(phone2);
>> m_phone2=phone2;
>> this.m_sAccountNO=accountno;
>> if(this.m_oPhoneCall.isFirstCall(m_oDB,name)){
>> System.err.println("FirstCall");
>> this.jTextFieldNotes.setText("First Call:");
>> this.m_bfcall=true;
>> } else System.err.println("not F call");
>> }
>> public void setCallList(javax.swing.JList p_list){
>> m_oCallList=p_list;
>> }
>> // Variables declaration - do not modify//GEN-BEGIN:variables
>> private javax.swing.JLabel jLabel4;
>> private javax.swing.JTextField phone2JTextField;
>> private javax.swing.JLabel jLabel1;
>> private javax.swing.JLabel jLabel3;
>> private javax.swing.JTextField phoneJTextField;
>> private javax.swing.JLabel jLabel2;
>> private javax.swing.JLabel prijLabel;
>> private javax.swing.JComboBox statusjComboBox;
>> private javax.swing.JButton cancle;
>> private javax.swing.JTextField jTextFieldNotes;
>> private javax.swing.JButton jButtonOk;
>> private javax.swing.JTextField nameJTextField;
>> private javax.swing.JButton jButtionJSwitch;
>> private javax.swing.JComboBox priComboBox;
>> private javax.swing.JComboBox jComboBoxFor;
>> private javax.swing.JLabel forjLabel;
>> private javax.swing.JLabel jLabel5;
>> // End of variables declaration//GEN-END:variables
>> }
>
>
>
>
>
> ------------------------------------------------------------ ------------
>
> /*
> * AddCallDLG.java
> *
> * Created on July 16, 2001, 1:57 PM
> */
>
>
> /**
> *
> * @author david
> * @version
> */
> /* Todo
> * Make it so you pass a Phone call to the dialog and it fills it in fo you.
> *
> **/
> import javax.swing.JComboBox;
> import java.util.ArrayList;
>
> public class AddCallDLG extends javax.swing.JDialog {
> private ErrorLogging m_oErrLog;
> private int i_switch=0;
> String m_sAccountNO;
> private String m_phone, m_phone2;
> boolean m_bOkay=false;
> private boolean m_bfcall=false;
> javax.swing.JList m_oCallList;
> private PhoneCall m_oPhoneCall;
> private MyDataBase m_oDB;
> /** Creates new form AddCallDLG */
>
> public AddCallDLG(PhoneMainFrame parent,boolean modal,PhoneCall p_phone,ErrorLogging errorlog) {
> super(parent, modal);
> //PhoneMainFrame mf = (PhoneMainFrame) parent;
> m_oDB=parent.o_SqlConnection;
> m_oErrLog=errorlog;
> m_oPhoneCall=p_phone;
> initComponents();
> pack();
> }
>
> public int getStatusData(String name){
> int retval=0;
> try{
> java.sql.Statement stmt = m_oDB.m_sqlConnection.createStatement();
> java.sql.ResultSet rs = stmt.executeQuery("Select * FROM phonegroups WHERE pgroup = '"+name+"'");
> PhoneUser t_phoneuser=null;
> //create an ArrayList of PhoneCalls
> if (rs.next()){
> retval=1;
> }
> else {
> rs = stmt.executeQuery("Select * FROM phoneusers WHERE username= '"+name+"'");
> //create an ArrayList of PhoneCalls
> if (rs.next()){
> t_phoneuser = new PhoneUser(m_oDB,rs);
> retval=t_phoneuser.getUserStatus();
> }
>
> }
> } catch (Exception ex){
> // TODO Add more errorchecking code here.
> System.err.println(ex.toString());
>
> }
> return retval;
> }
> /** 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 FormEditor.
> */
> private void initComponents() {//GEN-BEGIN:initComponents
> // java.awt.GridBagConstraints gridBagConstraints; VE requires distinct constraints
>
> jLabel1 = new javax.swing.JLabel();
> jLabel2 = new javax.swing.JLabel();
> jLabel3 = new javax.swing.JLabel();
> jLabel4 = new javax.swing.JLabel();
> jLabel5 = new javax.swing.JLabel();
> nameJTextField = new javax.swing.JTextField();
> phoneJTextField = new javax.swing.JTextField();
> phone2JTextField = new javax.swing.JTextField();
> statusjComboBox = new javax.swing.JComboBox();
> jTextFieldNotes = new javax.swing.JTextField();
> jButtonOk = new javax.swing.JButton();
> cancle = new javax.swing.JButton();
> prijLabel = new javax.swing.JLabel();
> priComboBox = new javax.swing.JComboBox();
> forjLabel = new javax.swing.JLabel();
> jComboBoxFor = new javax.swing.JComboBox();
> jButtionJSwitch = new javax.swing.JButton();
>
> jDialogContentPane = new javax.swing.JPanel() ; // Explicit content pane
> setContentPane(jDialogContentPane);
> jDialogContentPane.setLayout(new java.awt.GridBagLayout());
>
> setTitle("Add a Call");
> addComponentListener(new java.awt.event.ComponentAdapter() {
> public void componentShown(java.awt.event.ComponentEvent evt) {
> formComponentShown(evt);
> }
> });
>
> addWindowListener(new java.awt.event.WindowAdapter() {
> public void windowClosing(java.awt.event.WindowEvent evt) {
> closeDialog(evt);
> }
> });
>
> jLabel1.setDisplayedMnemonic('N');
> jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel1.setLabelFor(nameJTextField);
> jLabel1.setText("Name");
> java.awt.GridBagConstraints l1gridBagConstraints = new java.awt.GridBagConstraints();
> l1gridBagConstraints.gridx = 0;
> l1gridBagConstraints.gridy = 0;
> l1gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> l1gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(jLabel1, l1gridBagConstraints);
>
> jLabel2.setDisplayedMnemonic('P');
> jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel2.setLabelFor(phoneJTextField);
> jLabel2.setText("Phone");
> java.awt.GridBagConstraints l2gridBagConstraints = new java.awt.GridBagConstraints();
> l2gridBagConstraints.gridx = 0;
> l2gridBagConstraints.gridy = 1;
> l2gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> l2gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(jLabel2, l2gridBagConstraints);
>
> jLabel3.setDisplayedMnemonic('2');
> jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel3.setLabelFor(phone2JTextField);
> jLabel3.setText("Phone2");
> java.awt.GridBagConstraints l3gridBagConstraints = new java.awt.GridBagConstraints();
> l3gridBagConstraints.gridx = 0;
> l3gridBagConstraints.gridy = 2;
> l3gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> l3gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(jLabel3, l3gridBagConstraints);
>
> jLabel4.setDisplayedMnemonic('a');
> jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel4.setLabelFor(statusjComboBox);
> jLabel4.setText("Status");
> java.awt.GridBagConstraints l4gridBagConstraints = new java.awt.GridBagConstraints();
> l4gridBagConstraints.gridx = 0;
> l4gridBagConstraints.gridy = 3;
> l4gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> l4gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(jLabel4, l4gridBagConstraints);
>
> jLabel5.setDisplayedMnemonic('t');
> jLabel5.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel5.setLabelFor(jTextFieldNotes);
> jLabel5.setText("Note");
> java.awt.GridBagConstraints l5gridBagConstraints = new java.awt.GridBagConstraints();
> l5gridBagConstraints.gridx = 0;
> l5gridBagConstraints.gridy = 5;
> l5gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> l5gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(jLabel5, l5gridBagConstraints);
>
> nameJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> nameJTextFieldFocusGained(evt);
> }
> });
>
> nameJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> nameJTextFieldKeyTyped(evt);
> }
> });
>
> java.awt.GridBagConstraints ntfgridBagConstraints = new java.awt.GridBagConstraints();
> ntfgridBagConstraints.gridx = 1;
> ntfgridBagConstraints.gridy = 0;
> ntfgridBagConstraints.gridwidth = 5;
> ntfgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> ntfgridBagConstraints.ipadx = 396;
> ntfgridBagConstraints.ipady = 10;
> ntfgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> jDialogContentPane.add(nameJTextField, ntfgridBagConstraints);
>
> phoneJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> phoneJTextFieldFocusGained(evt);
> }
> });
>
> phoneJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> phoneJTextFieldKeyTyped(evt);
> }
> });
>
> java.awt.GridBagConstraints ptfgridBagConstraints = new java.awt.GridBagConstraints();
> ptfgridBagConstraints.gridx = 1;
> ptfgridBagConstraints.gridy = 1;
> ptfgridBagConstraints.gridwidth = 4;
> ptfgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> ptfgridBagConstraints.ipadx = 396;
> ptfgridBagConstraints.ipady = 10;
> ptfgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> jDialogContentPane.add(phoneJTextField, ptfgridBagConstraints);
>
> phone2JTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> phone2JTextFieldFocusGained(evt);
> }
> });
>
> phone2JTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> phone2JTextFieldKeyTyped(evt);
> }
> });
>
> java.awt.GridBagConstraints ptf2gridBagConstraints = new java.awt.GridBagConstraints();
> ptf2gridBagConstraints.gridx = 1;
> ptf2gridBagConstraints.gridy = 2;
> ptf2gridBagConstraints.gridwidth = 4;
> ptf2gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> ptf2gridBagConstraints.ipadx = 396;
> ptf2gridBagConstraints.ipady = 10;
> ptf2gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> jDialogContentPane.add(phone2JTextField, ptf2gridBagConstraints);
>
> statusjComboBox.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> statusjComboBoxActionPerformed(evt);
> }
> });
>
> statusjComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> statusjComboBoxMouseWheelMoved(evt);
> }
> });
>
> java.awt.GridBagConstraints statgridBagConstraints = new java.awt.GridBagConstraints();
> statgridBagConstraints.gridx = 1;
> statgridBagConstraints.gridy = 3;
> statgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> statgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> jDialogContentPane.add(statusjComboBox, statgridBagConstraints);
>
> jTextFieldNotes.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> jTextFieldNotesFocusGained(evt);
> }
> });
>
> jTextFieldNotes.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> jTextFieldNotesKeyTyped(evt);
> }
> });
>
> java.awt.GridBagConstraints ngridBagConstraints = new java.awt.GridBagConstraints();
> ngridBagConstraints.gridx = 1;
> ngridBagConstraints.gridy = 5;
> ngridBagConstraints.gridwidth = 5;
> ngridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> ngridBagConstraints.ipadx = 500;
> ngridBagConstraints.ipady = 10;
> ngridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> jDialogContentPane.add(jTextFieldNotes, ngridBagConstraints);
>
> jButtonOk.setMnemonic('O');
> jButtonOk.setText("Ok");
> jButtonOk.setSelected(true);
> jButtonOk.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> jButtonOkActionPerformed(evt);
> }
> });
>
> java.awt.GridBagConstraints okgridBagConstraints = new java.awt.GridBagConstraints();
> okgridBagConstraints.gridx = 1;
> okgridBagConstraints.gridy = 6;
> okgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> okgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> jDialogContentPane.add(jButtonOk, okgridBagConstraints);
>
> cancle.setMnemonic('C');
> cancle.setText("Cancel");
> cancle.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> cancleActionPerformed(evt);
> }
> });
>
> java.awt.GridBagConstraints cancelgridBagConstraints = new java.awt.GridBagConstraints();
> cancelgridBagConstraints.gridx = 5;
> cancelgridBagConstraints.gridy = 6;
> cancelgridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
> cancelgridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
> cancelgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> jDialogContentPane.add(cancle, cancelgridBagConstraints);
>
> prijLabel.setDisplayedMnemonic('r');
> prijLabel.setFont(new java.awt.Font("Dialog", 0, 14));
> prijLabel.setLabelFor(priComboBox);
> prijLabel.setText("Priority ");
> prijLabel.setName("Add Call");
> java.awt.GridBagConstraints prigridBagConstraints = new java.awt.GridBagConstraints();
> prigridBagConstraints.gridx = 2;
> prigridBagConstraints.gridy = 3;
> prigridBagConstraints.gridwidth = 2;
> prigridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> jDialogContentPane.add(prijLabel, prigridBagConstraints);
>
> priComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> priComboBoxMouseWheelMoved(evt);
> }
> });
>
> java.awt.GridBagConstraints pricbgridBagConstraints = new java.awt.GridBagConstraints();
> pricbgridBagConstraints.gridx = 4;
> pricbgridBagConstraints.gridy = 3;
> pricbgridBagConstraints.gridwidth = 2;
> pricbgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> pricbgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> jDialogContentPane.add(priComboBox, pricbgridBagConstraints);
>
> forjLabel.setDisplayedMnemonic('F');
> forjLabel.setFont(new java.awt.Font("Dialog", 0, 14));
> forjLabel.setLabelFor(jComboBoxFor);
> forjLabel.setText("For");
> java.awt.GridBagConstraints lgridBagConstraints = new java.awt.GridBagConstraints();
> lgridBagConstraints.gridx = 0;
> lgridBagConstraints.gridy = 4;
> lgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> lgridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(forjLabel, lgridBagConstraints);
>
> jComboBoxFor.addMouseListener(new java.awt.event.MouseAdapter() {
> public void mouseReleased(java.awt.event.MouseEvent evt) {
> jComboBoxForMouseReleased(evt);
> }
> });
>
> jComboBoxFor.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> jComboBoxForMouseWheelMoved(evt);
> }
> });
>
> jComboBoxFor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
> public void propertyChange(java.beans.PropertyChangeEvent evt) {
> jComboBoxForPropertyChange(evt);
> }
> });
>
> java.awt.GridBagConstraints forgridBagConstraints = new java.awt.GridBagConstraints();
> forgridBagConstraints.gridx = 1;
> forgridBagConstraints.gridy = 4;
> forgridBagConstraints.gridwidth = 5;
> forgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> forgridBagConstraints.ipadx = 260;
> forgridBagConstraints.ipady = 5;
> forgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> jDialogContentPane.add(jComboBoxFor, forgridBagConstraints);
>
> jButtionJSwitch.setMnemonic('S');
> jButtionJSwitch.setText("Switch");
> jButtionJSwitch.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> jButtionJSwitchActionPerformed(evt);
> }
> });
>
> java.awt.GridBagConstraints sgridBagConstraints = new java.awt.GridBagConstraints();
> sgridBagConstraints.gridx = 5;
> sgridBagConstraints.gridy = 1;
> sgridBagConstraints.gridheight = 2;
> sgridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
> sgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> jDialogContentPane.add(jButtionJSwitch, sgridBagConstraints);
>
> }//GEN-END:initComponents
>
> private void jTextFieldNotesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldNotesFocusGained
> // Add your handling code here:
> if(this.m_bfcall){
> this.jTextFieldNotes.setCaretPosition(this.jTextFieldNotes.g etText().length());
> } else this.setSelectTextAll(this.jTextFieldNotes);
> }//GEN-LAST:event_jTextFieldNotesFocusGained
>
> private void phone2JTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phone2JTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.phone2JTextField);
> }//GEN-LAST:event_phone2JTextFieldFocusGained
>
> private void nameJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_nameJTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.nameJTextField);
> }//GEN-LAST:event_nameJTextFieldFocusGained
>
> private void phoneJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phoneJTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.phoneJTextField);
> }//GEN-LAST:event_phoneJTextFieldFocusGained
> private static void setSelectTextAll(javax.swing.JTextField textField){
> textField.setSelectionStart(0);
> textField.setSelectionEnd(textField.getText().length());
> }
> private void jComboBoxForMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_jComboBoxForMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.jComboBoxFor);
> }//GEN-LAST:event_jComboBoxForMouseWheelMoved
>
> private void statusjComboBoxMouseWheelMoved(java.awt.event.MouseWheelEven t evt) {//GEN-FIRST:event_statusjComboBoxMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.statusjComboBox);
> }//GEN-LAST:event_statusjComboBoxMouseWheelMoved
>
> private void scrollWheelComboBox(java.awt.event.MouseWheelEvent evt, javax.swing.JComboBox cBox){
> int i_inc = +1;
> if(evt.getWheelRotation()<0) {i_inc=-1;}
> int pos=cBox.getSelectedIndex()+i_inc;
> if(pos>=cBox.getItemCount()) pos=0;
> if(pos<0) pos=cBox.getItemCount()-1;
> cBox.setSelectedIndex(pos);
> }
> private void priComboBoxMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_priComboBoxMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.priComboBox);
> }//GEN-LAST:event_priComboBoxMouseWheelMoved
>
> private void jComboBoxForMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxForMouseReleased
> // Add your handling code here:
> String user =(String)this.jComboBoxFor.getSelectedItem();
> if (user!=null) if (getStatusData(user)==0){
> System.err.println("not On Phone");
> }
> }//GEN-LAST:event_jComboBoxForMouseReleased
>
> private void jComboBoxForPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jComboBoxForPropertyChange
> // Add your handling code here:
> String user =(String)this.jComboBoxFor.getSelectedItem();
> if (user!=null) if (getStatusData(user)==0){
> new NotHereDLG(new javax.swing.JFrame(), true,user).show();
> }
> }//GEN-LAST:event_jComboBoxForPropertyChange
>
> private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
> // Add your handling code here:
> checkTextFieldLen(jTextFieldNotes,3998);
> checkTextFieldLen(phone2JTextField,39);
> checkTextFieldLen(phoneJTextField,39);
> checkTextFieldLen(nameJTextField,79);
> if(this.m_bfcall){
> this.priComboBox.setSelectedIndex(1);
> javax.swing.JOptionPane.showMessageDialog(this,"First Call");
> }
> }//GEN-LAST:event_formComponentShown
>
> private void jTextFieldNotesKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldNotesKeyTyped
> // Add your handling code here:
> checkTextFieldLen(jTextFieldNotes,3998);
> }//GEN-LAST:event_jTextFieldNotesKeyTyped
>
> private void phone2JTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phone2JTextFieldKeyTyped
> // Add your handling code here:
> checkTextFieldLen(phone2JTextField,39);
> }//GEN-LAST:event_phone2JTextFieldKeyTyped
>
> private void phoneJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phoneJTextFieldKeyTyped
> checkTextFieldLen(phoneJTextField,39);
> // Add your handling code here:
> }//GEN-LAST:event_phoneJTextFieldKeyTyped
>
> private void nameJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nameJTextFieldKeyTyped
> // Add your handling code here:
> checkTextFieldLen(nameJTextField,79);
> }//GEN-LAST:event_nameJTextFieldKeyTyped
>
> private void jButtionJSwitchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtionJSwitchActionPerformed
> // Add your handling code here:
> switch(i_switch){
> case 0:
> i_switch++;
> phoneJTextField.setText(m_phone2);
> phone2JTextField.setText(m_phone);
> break;
> case 1:
> i_switch++;
> phoneJTextField.setText("");
> phone2JTextField.setText(m_phone);
> phoneJTextField.requestFocus();
> break;
> default :
> i_switch=0;
> phoneJTextField.setText(m_phone);
> phone2JTextField.setText(m_phone2);
> }
> }//GEN-LAST:event_jButtionJSwitchActionPerformed
> private void checkTextFieldLen(javax.swing.JTextField f, int size){
> String text= f.getText();
> if(text.length()>size){
> text=text.substring(0,size);
> f.setText(text);
> }
> }
> private void cancleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancleActionPerformed
> // Add your handling code here:
> setVisible(false);
> dispose();
> }//GEN-LAST:event_cancleActionPerformed
>
> private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
> // Add your handling code here:
> this.m_bOkay=true;
> m_
Re: VE importing NetBeans [message #9163 is a reply to message #8977] Tue, 09 December 2003 14:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mendelgili.netscape.net

David Siebert wrote:
Thanks
> Netbeans does generate a .form file that is in XML that defines the Form.
> I do not know if importing from NetBeans is even on the VE new feature
> list. But I had have a lot of .forms that I would be glad ot share with
> you all if it is wanted or needed.
>

Thanks. I would be interested to see a .forms file structure.
In any case, the goal of VE is to be able to deal with common code
patterns off hand, so that it becomes a *visual code assist* on steroids
for GUI building ;-) regardless of how the code was originated. The
NetBean pattern is quite common; and mostly recognized today by VE.
Re: VE importing NetBeans [message #9186 is a reply to message #9163] Tue, 09 December 2003 15:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david.eclipsecat.com

This is a multi-part message in MIME format.
--------------070402050305020508040502
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Here is the .form file for that file I posted earlyer. It looks like a
pretty easy to parse XML File to me.
BTW this is part of our telephone call system that I wrote. It replaced
a system that was written in Delphi that used XBase as the backend. I
wrote the Java based system after only playing with Java a few weeks. It
has been up for 3 years without a single crash. I for one am pretty fond
of Java on the desktop.



--------------070402050305020508040502
Content-Type: text/xml;
name="AddCallDLG.form"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="AddCallDLG.form"

<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.0" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="title" type="java.lang.String" value="Add a Call"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="2"/>
</SyntheticProperties>
<Events>
<EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentShown"/>
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
</Events>
<AuxValues>
<AuxValue name="designerSize" type="java.awt.Dimension" value=" -84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,1 05,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20, 2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116, 104,120,112,0,0,1,44,0,0,2,68 "/>
</AuxValues>

<Layout class=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t "/>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="displayedMnemonic" type="int" value="78"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="nameJTextField"/>
</Property>
<Property name="text" type="java.lang.String" value="Name"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="displayedMnemonic" type="int" value="80"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="phoneJTextField"/>
</Property>
<Property name="text" type="java.lang.String" value="Phone"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="displayedMnemonic" type="int" value="50"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="phone2JTextField"/>
</Property>
<Property name="text" type="java.lang.String" value="Phone2"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="displayedMnemonic" type="int" value="97"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="statusjComboBox"/>
</Property>
<Property name="text" type="java.lang.String" value="Status"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="displayedMnemonic" type="int" value="116"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="jTextFieldNotes"/>
</Property>
<Property name="text" type="java.lang.String" value="Note"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="nameJTextField">
<Events>
<EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="nameJTextFieldFocusGained"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="nameJTextFieldKeyTyped"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="0" gridWidth="5" gridHeight="1" fill="1" ipadX="396" ipadY="10" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="phoneJTextField">
<Events>
<EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="phoneJTextFieldFocusGained"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="phoneJTextFieldKeyTyped"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="1" gridWidth="4" gridHeight="1" fill="1" ipadX="396" ipadY="10" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="phone2JTextField">
<Events>
<EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="phone2JTextFieldFocusGained"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="phone2JTextFieldKeyTyped"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="2" gridWidth="4" gridHeight="1" fill="1" ipadX="396" ipadY="10" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JComboBox" name="statusjComboBox">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="statusjComboBoxActionPerformed"/>
<EventHandler event="mouseWheelMoved" listener="java.awt.event.MouseWheelListener" parameters="java.awt.event.MouseWheelEvent" handler="statusjComboBoxMouseWheelMoved"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value=""/>
</AuxValues>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="jTextFieldNotes">
<Events>
<EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="jTextFieldNotesFocusGained"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jTextFieldNotesKeyTyped"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="5" gridWidth="5" gridHeight="1" fill="1" ipadX="500" ipadY="10" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="jButtonOk">
<Properties>
<Property name="mnemonic" type="int" value="79"/>
<Property name="text" type="java.lang.String" value="Ok"/>
<Property name="selected" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonOkActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="6" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="cancle">
<Properties>
<Property name="mnemonic" type="int" value="67"/>
<Property name="text" type="java.lang.String" value="Cancel"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancleActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="5" gridY="6" gridWidth="1" gridHeight="1" fill="3" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="3" anchor="13" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="prijLabel">
<Properties>
<Property name="displayedMnemonic" type="int" value="114"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="priComboBox"/>
</Property>
<Property name="text" type="java.lang.String" value="Priority "/>
<Property name="name" type="java.lang.String" value="Add Call"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="2" gridY="3" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JComboBox" name="priComboBox">
<Events>
<EventHandler event="mouseWheelMoved" listener="java.awt.event.MouseWheelListener" parameters="java.awt.event.MouseWheelEvent" handler="priComboBoxMouseWheelMoved"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="4" gridY="3" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="forjLabel">
<Properties>
<Property name="displayedMnemonic" type="int" value="70"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="jComboBoxFor"/>
</Property>
<Property name="text" type="java.lang.String" value="For"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JComboBox" name="jComboBoxFor">
<Events>
<EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jComboBoxForMouseReleased"/>
<EventHandler event="mouseWheelMoved" listener="java.awt.event.MouseWheelListener" parameters="java.awt.event.MouseWheelEvent" handler="jComboBoxForMouseWheelMoved"/>
<EventHandler event="propertyChange" listener="java.beans.PropertyChangeListener" parameters="java.beans.PropertyChangeEvent" handler="jComboBoxForPropertyChange"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="4" gridWidth="5" gridHeight="1" fill="1" ipadX="260" ipadY="5" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="jButtionJSwitch">
<Properties>
<Property name="mnemonic" type="int" value="83"/>
<Property name="text" type="java.lang.String" value="Switch"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtionJSwitchActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="5" gridY="1" gridWidth="1" gridHeight="2" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Form>

--------------070402050305020508040502--
Re: VE importing NetBeans [message #110571 is a reply to message #8208] Fri, 04 November 2005 20:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dennis.dataaccess.com

On Thu, 04 Dec 2003 10:28:55 -0500, David Siebert
<david@eclipsecat.com> wrote:

>I did try it and it looks a little odd. Actually I tried it before I posted.
>What is odd is that it looks like all of the elements are there but they
>are not put together. I do not know it that is the way that VE supposed
>to look or not. I just got Eclipse working and I am considering using it
>instead of NetBeans. Net Beans has been very good to me but it is a
>little slow.
>
>Peter Walker wrote:
>> This is not officially supported and I haven't tried this yet... not sure
>> what the code looks like that comes out of Netbeans. If the code patterns
>> are such that each AWT/Swing component is declared in the class and has a
>> method that initializes it (i.e. jButton = new JButton()), it should work.
>> Please feel free to try it and report your results.
>>
>> Thanks...
>> Peter walker
>>

Hi all,

I just had the same experience. I'm pretty surprised this has not
changed in almost 2 years...

Regards,
Dennis
Re: VE importing NetBeans [message #110588 is a reply to message #110571] Fri, 04 November 2005 22:14 Go to previous message
Dennis Piccioni is currently offline Dennis PiccioniFriend
Messages: 3
Registered: July 2009
Junior Member
>Hi all,
>
>I just had the same experience. I'm pretty surprised this has not
>changed in almost 2 years...
>
>Regards,
>Dennis

I have now read the other threads about doing this, and I have to say
it's pretty lame that Eclipse doesn't just handle this more
appropriately, such as asking the user if he/she wants to convert the
code, or just doing so. Importing existing NetBeans visual code like
this turns out to be either a tedious project to get it right, or
winds up having weird looking stuff that's hard to work with if you
want to make changes in the VE later.

Regards,
Dennis
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #567543 is a reply to message #2400] Thu, 20 November 2003 15:12 Go to previous message
Peter Walker is currently offline Peter WalkerFriend
Messages: 124
Registered: July 2009
Senior Member
Thorbjoern,
As Dave Orme (VE project lead) mentioned in the eclipse.platform newsgroup:

"The 1.0 version will support 3.0. We're an Eclipse project now so we're
merging our development cycle with Eclipse's. But that will be a
process that won't happen overnight."

This is our next release.

Regards...
Peter Walker

"Thorbj
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #567577 is a reply to message #2400] Thu, 20 November 2003 15:17 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

0.5.0 will shortly be a release. Releases need to run on released
pre-reqs. 3.0M4 is still not a release, so we didn't want to pre-req it.
The current Eclipse release is 2.1.2. So that is why it is for 2.1.2.

And unfortunately, no it won't run on 3.0M4 because there have been
significant changes in parts of the base Eclipse code that causes the
editor to not work. The 1.0.0 development stream will eventually step up
to 3.0, but that won't be for a little while yet. There will be a major
API breaking change in 3.0 being released with 3.0M5, and we don't want
to spend our time doing two migrations. We only want to do it once.

We also have some important things we want to work on, like fixing some
of the larger performance problems and we want a stable platform for that.

--
Thanks, Rich Kulp

Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #567746 is a reply to message #2459] Fri, 21 November 2003 03:50 Go to previous message
Ed Burnette is currently offline Ed BurnetteFriend
Messages: 279
Registered: July 2009
Senior Member
Unless you like answering this question a *lot*, I strongly suggest you move
up to 3.0M* as soon as possible. The CDT project is doing that next week I
believe. Ideally, a project's HEAD would work with Platform's HEAD.

--
Ed Burnette, co-author, Eclipse in Action
www.eclipsepowered.org

"Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
news:bpilq9$b2q$1@eclipse.org...
> 0.5.0 will shortly be a release. Releases need to run on released
> pre-reqs. 3.0M4 is still not a release, so we didn't want to pre-req it.
> The current Eclipse release is 2.1.2. So that is why it is for 2.1.2.
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #568137 is a reply to message #2430] Fri, 21 November 2003 16:47 Go to previous message
Eclipse UserFriend
Originally posted by: use.reply.to.invalid

Peter Walker wrote:

> Thorbjoern,
> As Dave Orme (VE project lead) mentioned in the eclipse.platform newsgroup:
>
> "The 1.0 version will support 3.0. We're an Eclipse project now so we're
> merging our development cycle with Eclipse's. But that will be a
> process that won't happen overnight."
>
> This is our next release.
>
> Regards...
> Peter Walker

Thank you for the response and the pointer. I'll just sit on my hands
for a while then :)

--
Thorbjoern Ravn Andersen "...plus...Tubular Bells!"
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #568169 is a reply to message #2669] Fri, 21 November 2003 17:21 Go to previous message
Bob Herrmann is currently offline Bob HerrmannFriend
Messages: 10
Registered: July 2009
Junior Member
Ed Burnette wrote:
> Unless you like answering this question a *lot*, I strongly suggest you move
> up to 3.0M* as soon as possible. The CDT project is doing that next week I
> believe. Ideally, a project's HEAD would work with Platform's HEAD.

The reasons for waiting to support 3.0M* seem sound, but since M4 is works
so darn well - I agree this will come up a great deal.

At a minium I recommend plastering the FAQ, and the Download page of VEP
with a note that it won't work with 3.0M* for a bit...

Cheers,
-bob

> --
> Ed Burnette, co-author, Eclipse in Action
> www.eclipsepowered.org

> "Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
> news:bpilq9$b2q$1@eclipse.org...
> > 0.5.0 will shortly be a release. Releases need to run on released
> > pre-reqs. 3.0M4 is still not a release, so we didn't want to pre-req it.
> > The current Eclipse release is 2.1.2. So that is why it is for 2.1.2.
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #569325 is a reply to message #3827] Wed, 26 November 2003 02:41 Go to previous message
David J. Orme is currently offline David J. OrmeFriend
Messages: 291
Registered: July 2009
Senior Member
Bob Herrmann wrote:
> Ed Burnette wrote:
>
>>Unless you like answering this question a *lot*, I strongly suggest you move
>>up to 3.0M* as soon as possible. The CDT project is doing that next week I
>>believe. Ideally, a project's HEAD would work with Platform's HEAD.
>
>
> The reasons for waiting to support 3.0M* seem sound, but since M4 is works
> so darn well - I agree this will come up a great deal.
>
> At a minium I recommend plastering the FAQ, and the Download page of VEP
> with a note that it won't work with 3.0M* for a bit...
>
> Cheers,
> -bob

Thanks! I think I'll do just that.


Regards,

Dave
--
Dave Orme
Eclipse Visual Editor Project Lead
Advanced Systems Concepts' Chief Architect
http://www.swtworkbench.com
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #569716 is a reply to message #5558] Wed, 26 November 2003 21:41 Go to previous message
Scott Ellsworth is currently offline Scott EllsworthFriend
Messages: 20
Registered: July 2009
Junior Member
In article <bq13vi$12s$1@eclipse.org>,
"David J. Orme" <daveo@asc-iseries.com> wrote:

> Bob Herrmann wrote:
> > Ed Burnette wrote:
> >
> >>Unless you like answering this question a *lot*, I strongly suggest you move
> >>up to 3.0M* as soon as possible. The CDT project is doing that next week I
> >>believe. Ideally, a project's HEAD would work with Platform's HEAD.
> >
> >
> > The reasons for waiting to support 3.0M* seem sound, but since M4 is works
> > so darn well - I agree this will come up a great deal.
> >
> > At a minium I recommend plastering the FAQ, and the Download page of VEP
> > with a note that it won't work with 3.0M* for a bit...
> >
> > Cheers,
> > -bob
>
> Thanks! I think I'll do just that.

I would also add an estimated date for that. It does not have to be
screamingly accurate, but it would be good to know whether the
synchronization with recent M builds is something I should look for in
December, or in Q32004.

It looks quite spiffy, and was one of the missing pieces for my own GUI
development. Congrats!

(BTW, I use MacOS X, so please do qualify it there.)

Scott
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #570546 is a reply to message #2669] Sun, 30 November 2003 14:31 Go to previous message
Johan Compagner is currently offline Johan CompagnerFriend
Messages: 148
Registered: July 2009
Senior Member
Why not make a version that can be dropped into 2.1.x series
and then completey merge the code base into the base of eclipse it self?
This kind of thing needs to be in the base. Not as a add on that won't
keep up directly with the latest release of the main..

johan



Ed Burnette wrote:
> Unless you like answering this question a *lot*, I strongly suggest you move
> up to 3.0M* as soon as possible. The CDT project is doing that next week I
> believe. Ideally, a project's HEAD would work with Platform's HEAD.
>
> --
> Ed Burnette, co-author, Eclipse in Action
> www.eclipsepowered.org
>
> "Rich Kulp" <richkulp@NO.SPAM.us.ibm.com> wrote in message
> news:bpilq9$b2q$1@eclipse.org...
>
>>0.5.0 will shortly be a release. Releases need to run on released
>>pre-reqs. 3.0M4 is still not a release, so we didn't want to pre-req it.
>>The current Eclipse release is 2.1.2. So that is why it is for 2.1.2.
>
>
>
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #571816 is a reply to message #2430] Wed, 03 December 2003 21:46 Go to previous message
Eclipse UserFriend
Originally posted by: david.eclipsecat.com

Anyway to import Netbeans files into the visual editor and have them
come out looking right?

Peter Walker wrote:

> Thorbjoern,
> As Dave Orme (VE project lead) mentioned in the eclipse.platform newsgroup:
>
> "The 1.0 version will support 3.0. We're an Eclipse project now so we're
> merging our development cycle with Eclipse's. But that will be a
> process that won't happen overnight."
>
> This is our next release.
>
> Regards...
> Peter Walker
>
> "Thorbjørn Ravn Andersen" <use@reply.to.invalid> wrote in message
> news:bpiej0$o6$1@eclipse.org...
>
>>I would like to try out VE, but is somewhat taken back by Eclipse 2.1.2
>>listed as a prerequisite.
>>
>>Does the provided code run as well under 3.0M4 which I use on a daily
>
> basis?
>
>>--
>> Thorbjoern Ravn Andersen "...plus...Tubular Bells!"
>>
>
>
>
Re: Does VE also run under 3.0M4? 2.1.2 is listed as a prerequisite? [message #571899 is a reply to message #8084] Thu, 04 December 2003 14:03 Go to previous message
Peter Walker is currently offline Peter WalkerFriend
Messages: 124
Registered: July 2009
Senior Member
This is not officially supported and I haven't tried this yet... not sure
what the code looks like that comes out of Netbeans. If the code patterns
are such that each AWT/Swing component is declared in the class and has a
method that initializes it (i.e. jButton = new JButton()), it should work.
Please feel free to try it and report your results.

Thanks...
Peter walker

"David Siebert" <david@eclipsecat.com> wrote in message
news:bqllem$8ij$2@eclipse.org...
> Anyway to import Netbeans files into the visual editor and have them
> come out looking right?
>
> Peter Walker wrote:
>
> > Thorbjoern,
> > As Dave Orme (VE project lead) mentioned in the eclipse.platform
newsgroup:
> >
> > "The 1.0 version will support 3.0. We're an Eclipse project now so
we're
> > merging our development cycle with Eclipse's. But that will be a
> > process that won't happen overnight."
> >
> > This is our next release.
> >
> > Regards...
> > Peter Walker
> >
> > "Thorbj
VE importing NetBeans [message #571997 is a reply to message #8145] Thu, 04 December 2003 15:28 Go to previous message
Eclipse UserFriend
Originally posted by: david.eclipsecat.com

I did try it and it looks a little odd. Actually I tried it before I posted.
What is odd is that it looks like all of the elements are there but they
are not put together. I do not know it that is the way that VE supposed
to look or not. I just got Eclipse working and I am considering using it
instead of NetBeans. Net Beans has been very good to me but it is a
little slow.

Peter Walker wrote:
> This is not officially supported and I haven't tried this yet... not sure
> what the code looks like that comes out of Netbeans. If the code patterns
> are such that each AWT/Swing component is declared in the class and has a
> method that initializes it (i.e. jButton = new JButton()), it should work.
> Please feel free to try it and report your results.
>
> Thanks...
> Peter walker
>
> "David Siebert" <david@eclipsecat.com> wrote in message
> news:bqllem$8ij$2@eclipse.org...
>
>>Anyway to import Netbeans files into the visual editor and have them
>>come out looking right?
>>
>>Peter Walker wrote:
>>
>>
>>>Thorbjoern,
>>>As Dave Orme (VE project lead) mentioned in the eclipse.platform
>
> newsgroup:
>
>>>"The 1.0 version will support 3.0. We're an Eclipse project now so
>
> we're
>
>>>merging our development cycle with Eclipse's. But that will be a
>>>process that won't happen overnight."
>>>
>>>This is our next release.
>>>
>>>Regards...
>>>Peter Walker
>>>
>>>"Thorbjørn Ravn Andersen" <use@reply.to.invalid> wrote in message
>>>news:bpiej0$o6$1@eclipse.org...
>>>
>>>
>>>>I would like to try out VE, but is somewhat taken back by Eclipse 2.1.2
>>>>listed as a prerequisite.
>>>>
>>>>Does the provided code run as well under 3.0M4 which I use on a daily
>>>
>>>basis?
>>>
>>>
>>>>--
>>>> Thorbjoern Ravn Andersen "...plus...Tubular Bells!"
>>>>
>>>
>>>
>>>
>
>
Re: VE importing NetBeans [message #572087 is a reply to message #8208] Thu, 04 December 2003 17:47 Go to previous message
Gili Mendel is currently offline Gili MendelFriend
Messages: 338
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090206010809080200010505
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

David Siebert wrote:
> I did try it and it looks a little odd. Actually I tried it before I
> posted.
> What is odd is that it looks like all of the elements are there but they
> are not put together.

JVE has a default "getter" code pattern that will get more flexible as
we move forward. One can extend it (see pref. attachement)

If you provide a small src. code that you are trying to load JVE with,
and is not rendered the same as when it is run we can try and help you
understand the patterns differences.



I do not know it that is the way that VE supposed
> to look or not. I just got Eclipse working and I am considering using it
> instead of NetBeans. Net Beans has been very good to me but it is a
> little slow.
>
> Peter Walker wrote:
>
>> This is not officially supported and I haven't tried this yet... not sure
>> what the code looks like that comes out of Netbeans. If the code patterns
>> are such that each AWT/Swing component is declared in the class and has a
>> method that initializes it (i.e. jButton = new JButton()), it should
>> work.
>> Please feel free to try it and report your results.
>>
>> Thanks...
>> Peter walker
>>
>> "David Siebert" <david@eclipsecat.com> wrote in message
>> news:bqllem$8ij$2@eclipse.org...
>>
>>> Anyway to import Netbeans files into the visual editor and have them
>>> come out looking right?
>>>
>>> Peter Walker wrote:
>>>
>>>
>>>> Thorbjoern,
>>>> As Dave Orme (VE project lead) mentioned in the eclipse.platform
>>
>>
>> newsgroup:
>>
>>>> "The 1.0 version will support 3.0. We're an Eclipse project now so
>>
>>
>> we're
>>
>>>> merging our development cycle with Eclipse's. But that will be a
>>>> process that won't happen overnight."
>>>>
>>>> This is our next release.
>>>>
>>>> Regards...
>>>> Peter Walker
>>>>
>>>> "Thorbj
Re: VE importing NetBeans [message #572162 is a reply to message #8277] Thu, 04 December 2003 19:50 Go to previous message
Eclipse UserFriend
Originally posted by: david.eclipsecat.com

This is a multi-part message in MIME format.
--------------080300090806020007010700
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Here is the file I tried to export.
So far I find Eclipse to be pretty good. The Perl plugin seems to work
well. VE seems like it is a pretty nice piece of work but I have only
really just started to play with Eclipse. I have added two new features
to one of my programs today so I would say I am off to a good start.


--------------080300090806020007010700
Content-Type: text/plain;
name="AddCallDLG.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="AddCallDLG.java"

/*
* AddCallDLG.java
*
* Created on July 16, 2001, 1:57 PM
*/


/**
*
* @author david
* @version
*/
/* Todo
* Make it so you pass a Phone call to the dialog and it fills it in fo you.
*
**/
import javax.swing.JComboBox;
import java.util.ArrayList;

public class AddCallDLG extends javax.swing.JDialog {
private ErrorLogging m_oErrLog;
private int i_switch=0;
String m_sAccountNO;
private String m_phone, m_phone2;
boolean m_bOkay=false;
private boolean m_bfcall=false;
javax.swing.JList m_oCallList;
private PhoneCall m_oPhoneCall;
private MyDataBase m_oDB;
/** Creates new form AddCallDLG */

public AddCallDLG(PhoneMainFrame parent,boolean modal,PhoneCall p_phone,ErrorLogging errorlog) {
super(parent, modal);
//PhoneMainFrame mf = (PhoneMainFrame) parent;
m_oDB=parent.o_SqlConnection;
m_oErrLog=errorlog;
m_oPhoneCall=p_phone;
initComponents();
pack();
}

public int getStatusData(String name){
int retval=0;
try{
java.sql.Statement stmt = m_oDB.m_sqlConnection.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("Select * FROM phonegroups WHERE pgroup = '"+name+"'");
PhoneUser t_phoneuser=null;
//create an ArrayList of PhoneCalls
if (rs.next()){
retval=1;
}
else {
rs = stmt.executeQuery("Select * FROM phoneusers WHERE username= '"+name+"'");
//create an ArrayList of PhoneCalls
if (rs.next()){
t_phoneuser = new PhoneUser(m_oDB,rs);
retval=t_phoneuser.getUserStatus();
}

}
} catch (Exception ex){
// TODO Add more errorchecking code here.
System.err.println(ex.toString());

}
return retval;
}
/** 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 FormEditor.
*/
private void initComponents() {//GEN-BEGIN:initComponents
java.awt.GridBagConstraints gridBagConstraints;

jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
nameJTextField = new javax.swing.JTextField();
phoneJTextField = new javax.swing.JTextField();
phone2JTextField = new javax.swing.JTextField();
statusjComboBox = new javax.swing.JComboBox();
jTextFieldNotes = new javax.swing.JTextField();
jButtonOk = new javax.swing.JButton();
cancle = new javax.swing.JButton();
prijLabel = new javax.swing.JLabel();
priComboBox = new javax.swing.JComboBox();
forjLabel = new javax.swing.JLabel();
jComboBoxFor = new javax.swing.JComboBox();
jButtionJSwitch = new javax.swing.JButton();

getContentPane().setLayout(new java.awt.GridBagLayout());

setTitle("Add a Call");
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}
});

addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
closeDialog(evt);
}
});

jLabel1.setDisplayedMnemonic('N');
jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel1.setLabelFor(nameJTextField);
jLabel1.setText("Name");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(jLabel1, gridBagConstraints);

jLabel2.setDisplayedMnemonic('P');
jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel2.setLabelFor(phoneJTextField);
jLabel2.setText("Phone");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(jLabel2, gridBagConstraints);

jLabel3.setDisplayedMnemonic('2');
jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel3.setLabelFor(phone2JTextField);
jLabel3.setText("Phone2");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(jLabel3, gridBagConstraints);

jLabel4.setDisplayedMnemonic('a');
jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel4.setLabelFor(statusjComboBox);
jLabel4.setText("Status");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(jLabel4, gridBagConstraints);

jLabel5.setDisplayedMnemonic('t');
jLabel5.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel5.setLabelFor(jTextFieldNotes);
jLabel5.setText("Note");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 5;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(jLabel5, gridBagConstraints);

nameJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
nameJTextFieldFocusGained(evt);
}
});

nameJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
nameJTextFieldKeyTyped(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
gridBagConstraints.gridwidth = 5;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 396;
gridBagConstraints.ipady = 10;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
getContentPane().add(nameJTextField, gridBagConstraints);

phoneJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
phoneJTextFieldFocusGained(evt);
}
});

phoneJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
phoneJTextFieldKeyTyped(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 1;
gridBagConstraints.gridwidth = 4;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 396;
gridBagConstraints.ipady = 10;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
getContentPane().add(phoneJTextField, gridBagConstraints);

phone2JTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
phone2JTextFieldFocusGained(evt);
}
});

phone2JTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
phone2JTextFieldKeyTyped(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 2;
gridBagConstraints.gridwidth = 4;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 396;
gridBagConstraints.ipady = 10;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
getContentPane().add(phone2JTextField, gridBagConstraints);

statusjComboBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
statusjComboBoxActionPerformed(evt);
}
});

statusjComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
statusjComboBoxMouseWheelMoved(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
getContentPane().add(statusjComboBox, gridBagConstraints);

jTextFieldNotes.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextFieldNotesFocusGained(evt);
}
});

jTextFieldNotes.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jTextFieldNotesKeyTyped(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 5;
gridBagConstraints.gridwidth = 5;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 500;
gridBagConstraints.ipady = 10;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
getContentPane().add(jTextFieldNotes, gridBagConstraints);

jButtonOk.setMnemonic('O');
jButtonOk.setText("Ok");
jButtonOk.setSelected(true);
jButtonOk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonOkActionPerformed(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 6;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
getContentPane().add(jButtonOk, gridBagConstraints);

cancle.setMnemonic('C');
cancle.setText("Cancel");
cancle.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancleActionPerformed(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 5;
gridBagConstraints.gridy = 6;
gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
getContentPane().add(cancle, gridBagConstraints);

prijLabel.setDisplayedMnemonic('r');
prijLabel.setFont(new java.awt.Font("Dialog", 0, 14));
prijLabel.setLabelFor(priComboBox);
prijLabel.setText("Priority ");
prijLabel.setName("Add Call");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 3;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
getContentPane().add(prijLabel, gridBagConstraints);

priComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
priComboBoxMouseWheelMoved(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 4;
gridBagConstraints.gridy = 3;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
getContentPane().add(priComboBox, gridBagConstraints);

forjLabel.setDisplayedMnemonic('F');
forjLabel.setFont(new java.awt.Font("Dialog", 0, 14));
forjLabel.setLabelFor(jComboBoxFor);
forjLabel.setText("For");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 4;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
getContentPane().add(forjLabel, gridBagConstraints);

jComboBoxFor.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(java.awt.event.MouseEvent evt) {
jComboBoxForMouseReleased(evt);
}
});

jComboBoxFor.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
jComboBoxForMouseWheelMoved(evt);
}
});

jComboBoxFor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
jComboBoxForPropertyChange(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 4;
gridBagConstraints.gridwidth = 5;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.ipadx = 260;
gridBagConstraints.ipady = 5;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
getContentPane().add(jComboBoxFor, gridBagConstraints);

jButtionJSwitch.setMnemonic('S');
jButtionJSwitch.setText("Switch");
jButtionJSwitch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtionJSwitchActionPerformed(evt);
}
});

gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 5;
gridBagConstraints.gridy = 1;
gridBagConstraints.gridheight = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
getContentPane().add(jButtionJSwitch, gridBagConstraints);

}//GEN-END:initComponents

private void jTextFieldNotesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldNotesFocusGained
// Add your handling code here:
if(this.m_bfcall){
this.jTextFieldNotes.setCaretPosition(this.jTextFieldNotes.g etText().length());
} else this.setSelectTextAll(this.jTextFieldNotes);
}//GEN-LAST:event_jTextFieldNotesFocusGained

private void phone2JTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phone2JTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.phone2JTextField);
}//GEN-LAST:event_phone2JTextFieldFocusGained

private void nameJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_nameJTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.nameJTextField);
}//GEN-LAST:event_nameJTextFieldFocusGained

private void phoneJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phoneJTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.phoneJTextField);
}//GEN-LAST:event_phoneJTextFieldFocusGained
private static void setSelectTextAll(javax.swing.JTextField textField){
textField.setSelectionStart(0);
textField.setSelectionEnd(textField.getText().length());
}
private void jComboBoxForMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_jComboBoxForMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.jComboBoxFor);
}//GEN-LAST:event_jComboBoxForMouseWheelMoved

private void statusjComboBoxMouseWheelMoved(java.awt.event.MouseWheelEven t evt) {//GEN-FIRST:event_statusjComboBoxMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.statusjComboBox);
}//GEN-LAST:event_statusjComboBoxMouseWheelMoved

private void scrollWheelComboBox(java.awt.event.MouseWheelEvent evt, javax.swing.JComboBox cBox){
int i_inc = +1;
if(evt.getWheelRotation()<0) {i_inc=-1;}
int pos=cBox.getSelectedIndex()+i_inc;
if(pos>=cBox.getItemCount()) pos=0;
if(pos<0) pos=cBox.getItemCount()-1;
cBox.setSelectedIndex(pos);
}
private void priComboBoxMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_priComboBoxMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.priComboBox);
}//GEN-LAST:event_priComboBoxMouseWheelMoved

private void jComboBoxForMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxForMouseReleased
// Add your handling code here:
String user =(String)this.jComboBoxFor.getSelectedItem();
if (user!=null) if (getStatusData(user)==0){
System.err.println("not On Phone");
}
}//GEN-LAST:event_jComboBoxForMouseReleased

private void jComboBoxForPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jComboBoxForPropertyChange
// Add your handling code here:
String user =(String)this.jComboBoxFor.getSelectedItem();
if (user!=null) if (getStatusData(user)==0){
new NotHereDLG(new javax.swing.JFrame(), true,user).show();
}
}//GEN-LAST:event_jComboBoxForPropertyChange

private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
// Add your handling code here:
checkTextFieldLen(jTextFieldNotes,3998);
checkTextFieldLen(phone2JTextField,39);
checkTextFieldLen(phoneJTextField,39);
checkTextFieldLen(nameJTextField,79);
if(this.m_bfcall){
this.priComboBox.setSelectedIndex(1);
javax.swing.JOptionPane.showMessageDialog(this,"First Call");
}
}//GEN-LAST:event_formComponentShown

private void jTextFieldNotesKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldNotesKeyTyped
// Add your handling code here:
checkTextFieldLen(jTextFieldNotes,3998);
}//GEN-LAST:event_jTextFieldNotesKeyTyped

private void phone2JTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phone2JTextFieldKeyTyped
// Add your handling code here:
checkTextFieldLen(phone2JTextField,39);
}//GEN-LAST:event_phone2JTextFieldKeyTyped

private void phoneJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phoneJTextFieldKeyTyped
checkTextFieldLen(phoneJTextField,39);
// Add your handling code here:
}//GEN-LAST:event_phoneJTextFieldKeyTyped

private void nameJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nameJTextFieldKeyTyped
// Add your handling code here:
checkTextFieldLen(nameJTextField,79);
}//GEN-LAST:event_nameJTextFieldKeyTyped

private void jButtionJSwitchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtionJSwitchActionPerformed
// Add your handling code here:
switch(i_switch){
case 0:
i_switch++;
phoneJTextField.setText(m_phone2);
phone2JTextField.setText(m_phone);
break;
case 1:
i_switch++;
phoneJTextField.setText("");
phone2JTextField.setText(m_phone);
phoneJTextField.requestFocus();
break;
default :
i_switch=0;
phoneJTextField.setText(m_phone);
phone2JTextField.setText(m_phone2);
}
}//GEN-LAST:event_jButtionJSwitchActionPerformed
private void checkTextFieldLen(javax.swing.JTextField f, int size){
String text= f.getText();
if(text.length()>size){
text=text.substring(0,size);
f.setText(text);
}
}
private void cancleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancleActionPerformed
// Add your handling code here:
setVisible(false);
dispose();
}//GEN-LAST:event_cancleActionPerformed

private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
// Add your handling code here:
this.m_bOkay=true;
m_oPhoneCall.setPhoneCall( nameJTextField.getText(), phoneJTextField.getText(), phone2JTextField.getText(),"", jComboBoxFor.getSelectedItem().toString() ,jTextFieldNotes.getText(),priComboBox.getSelectedItem().toS tring(),statusjComboBox.getSelectedItem().toString(),m_oDB);
setVisible(false);
}//GEN-LAST:event_jButtonOkActionPerformed

private void statusjComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_statusjComboBoxActionPerformed
// Add your handling code here:
}//GEN-LAST:event_statusjComboBoxActionPerformed

/** Closes the dialog */
private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
setVisible(false);
dispose();
}//GEN-LAST:event_closeDialog

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
//new AddCallDLG (new javax.swing.JFrame (), true).show ();
}

public void setPriList(String [] p_saList) {
for(int i=0;i<p_saList.length;i++){
this.priComboBox.addItem(makeObj(p_saList[i]));

}
}

public void setStatusList(String [] p_saList) {
for(int i=0;i<p_saList.length;i++){
this.statusjComboBox.addItem(makeObj(p_saList[i]));
}
}


public void setCallerListName(String name){
int inx=this.jComboBoxFor.getItemCount()-1;
while (inx>0 && ((String)this.jComboBoxFor.getItemAt(inx)).equalsIgnoreCase( name)== false){
inx--;
}
this.jComboBoxFor.setSelectedIndex(inx);
}

public void setCallerList(ArrayList p_saList) {
for(int i=0;i<p_saList.size();i++){
this.jComboBoxFor.addItem(p_saList.get(i));
}
}

public PhoneCall getPhoneCall(){
//public PhoneCall(String p_sCaller, String p_sPhone, String p_sPhone2, String p_sQedBy, String p_sFor, String p_sNotes, String p_sPri,String p_sStatus)
PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(), "",(String)jComboBoxFor.getSelectedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
return (pcall);
}
public PhoneCall getPhoneCall(String UserID){
PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(),UserID,(String)jComboBoxFor.getS electedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
return (pcall);
}

private Object makeObj(final String item) {
return new Object() { public String toString() { return item; } };
}

public void setCustInfo(String name, String phone, String phone2, String accountno){
nameJTextField.setText(name);
phoneJTextField.setText(phone);
m_phone=phone;
phone2JTextField.setText(phone2);
m_phone2=phone2;
this.m_sAccountNO=accountno;
if(this.m_oPhoneCall.isFirstCall(m_oDB,name)){
System.err.println("FirstCall");
this.jTextFieldNotes.setText("First Call:");
this.m_bfcall=true;
} else System.err.println("not F call");
}

public void setCallList(javax.swing.JList p_list){
m_oCallList=p_list;
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField phone2JTextField;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField phoneJTextField;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel prijLabel;
private javax.swing.JComboBox statusjComboBox;
private javax.swing.JButton cancle;
private javax.swing.JTextField jTextFieldNotes;
private javax.swing.JButton jButtonOk;
private javax.swing.JTextField nameJTextField;
private javax.swing.JButton jButtionJSwitch;
private javax.swing.JComboBox priComboBox;
private javax.swing.JComboBox jComboBoxFor;
private javax.swing.JLabel forjLabel;
private javax.swing.JLabel jLabel5;
// End of variables declaration//GEN-END:variables

}

--------------080300090806020007010700--
Re: VE importing NetBeans [message #572405 is a reply to message #8340] Fri, 05 December 2003 13:54 Go to previous message
Gili Mendel is currently offline Gili MendelFriend
Messages: 338
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010807050909080305090803
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

There are two pattern issues that inhibits VE to parse this code properly:

1. implicit content pane. VE requires (in this version) to explicitly
declare a content pane.

2. When using GridBag constraints, you will have to declare a unique
constraint for each component you are adding ... the code above reuse
the same variable (yet still allocate a new one).

I modified the code by hand, so that you can diff the files. Note that
there are many compile errors in the file, as this code reference
classes that are not available. The beauty of VE is that compile errors
that are not relevant are ignored.

David Siebert wrote:
> Here is the file I tried to export.
> So far I find Eclipse to be pretty good. The Perl plugin seems to work
> well. VE seems like it is a pretty nice piece of work but I have only
> really just started to play with Eclipse. I have added two new features
> to one of my programs today so I would say I am off to a good start.
>
>
> ------------------------------------------------------------ ------------
>
> /*
> * AddCallDLG.java
> *
> * Created on July 16, 2001, 1:57 PM
> */
>
>
> /**
> *
> * @author david
> * @version
> */
> /* Todo
> * Make it so you pass a Phone call to the dialog and it fills it in fo you.
> *
> **/
> import javax.swing.JComboBox;
> import java.util.ArrayList;
>
> public class AddCallDLG extends javax.swing.JDialog {
> private ErrorLogging m_oErrLog;
> private int i_switch=0;
> String m_sAccountNO;
> private String m_phone, m_phone2;
> boolean m_bOkay=false;
> private boolean m_bfcall=false;
> javax.swing.JList m_oCallList;
> private PhoneCall m_oPhoneCall;
> private MyDataBase m_oDB;
> /** Creates new form AddCallDLG */
>
> public AddCallDLG(PhoneMainFrame parent,boolean modal,PhoneCall p_phone,ErrorLogging errorlog) {
> super(parent, modal);
> //PhoneMainFrame mf = (PhoneMainFrame) parent;
> m_oDB=parent.o_SqlConnection;
> m_oErrLog=errorlog;
> m_oPhoneCall=p_phone;
> initComponents();
> pack();
> }
>
> public int getStatusData(String name){
> int retval=0;
> try{
> java.sql.Statement stmt = m_oDB.m_sqlConnection.createStatement();
> java.sql.ResultSet rs = stmt.executeQuery("Select * FROM phonegroups WHERE pgroup = '"+name+"'");
> PhoneUser t_phoneuser=null;
> //create an ArrayList of PhoneCalls
> if (rs.next()){
> retval=1;
> }
> else {
> rs = stmt.executeQuery("Select * FROM phoneusers WHERE username= '"+name+"'");
> //create an ArrayList of PhoneCalls
> if (rs.next()){
> t_phoneuser = new PhoneUser(m_oDB,rs);
> retval=t_phoneuser.getUserStatus();
> }
>
> }
> } catch (Exception ex){
> // TODO Add more errorchecking code here.
> System.err.println(ex.toString());
>
> }
> return retval;
> }
> /** 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 FormEditor.
> */
> private void initComponents() {//GEN-BEGIN:initComponents
> java.awt.GridBagConstraints gridBagConstraints;
>
> jLabel1 = new javax.swing.JLabel();
> jLabel2 = new javax.swing.JLabel();
> jLabel3 = new javax.swing.JLabel();
> jLabel4 = new javax.swing.JLabel();
> jLabel5 = new javax.swing.JLabel();
> nameJTextField = new javax.swing.JTextField();
> phoneJTextField = new javax.swing.JTextField();
> phone2JTextField = new javax.swing.JTextField();
> statusjComboBox = new javax.swing.JComboBox();
> jTextFieldNotes = new javax.swing.JTextField();
> jButtonOk = new javax.swing.JButton();
> cancle = new javax.swing.JButton();
> prijLabel = new javax.swing.JLabel();
> priComboBox = new javax.swing.JComboBox();
> forjLabel = new javax.swing.JLabel();
> jComboBoxFor = new javax.swing.JComboBox();
> jButtionJSwitch = new javax.swing.JButton();
>
> getContentPane().setLayout(new java.awt.GridBagLayout());
>
> setTitle("Add a Call");
> addComponentListener(new java.awt.event.ComponentAdapter() {
> public void componentShown(java.awt.event.ComponentEvent evt) {
> formComponentShown(evt);
> }
> });
>
> addWindowListener(new java.awt.event.WindowAdapter() {
> public void windowClosing(java.awt.event.WindowEvent evt) {
> closeDialog(evt);
> }
> });
>
> jLabel1.setDisplayedMnemonic('N');
> jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel1.setLabelFor(nameJTextField);
> jLabel1.setText("Name");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 0;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(jLabel1, gridBagConstraints);
>
> jLabel2.setDisplayedMnemonic('P');
> jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel2.setLabelFor(phoneJTextField);
> jLabel2.setText("Phone");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 1;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(jLabel2, gridBagConstraints);
>
> jLabel3.setDisplayedMnemonic('2');
> jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel3.setLabelFor(phone2JTextField);
> jLabel3.setText("Phone2");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 2;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(jLabel3, gridBagConstraints);
>
> jLabel4.setDisplayedMnemonic('a');
> jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel4.setLabelFor(statusjComboBox);
> jLabel4.setText("Status");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 3;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(jLabel4, gridBagConstraints);
>
> jLabel5.setDisplayedMnemonic('t');
> jLabel5.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel5.setLabelFor(jTextFieldNotes);
> jLabel5.setText("Note");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 5;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(jLabel5, gridBagConstraints);
>
> nameJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> nameJTextFieldFocusGained(evt);
> }
> });
>
> nameJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> nameJTextFieldKeyTyped(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 0;
> gridBagConstraints.gridwidth = 5;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.ipadx = 396;
> gridBagConstraints.ipady = 10;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> getContentPane().add(nameJTextField, gridBagConstraints);
>
> phoneJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> phoneJTextFieldFocusGained(evt);
> }
> });
>
> phoneJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> phoneJTextFieldKeyTyped(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 1;
> gridBagConstraints.gridwidth = 4;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.ipadx = 396;
> gridBagConstraints.ipady = 10;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> getContentPane().add(phoneJTextField, gridBagConstraints);
>
> phone2JTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> phone2JTextFieldFocusGained(evt);
> }
> });
>
> phone2JTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> phone2JTextFieldKeyTyped(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 2;
> gridBagConstraints.gridwidth = 4;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.ipadx = 396;
> gridBagConstraints.ipady = 10;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> getContentPane().add(phone2JTextField, gridBagConstraints);
>
> statusjComboBox.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> statusjComboBoxActionPerformed(evt);
> }
> });
>
> statusjComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> statusjComboBoxMouseWheelMoved(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 3;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> getContentPane().add(statusjComboBox, gridBagConstraints);
>
> jTextFieldNotes.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> jTextFieldNotesFocusGained(evt);
> }
> });
>
> jTextFieldNotes.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> jTextFieldNotesKeyTyped(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 5;
> gridBagConstraints.gridwidth = 5;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.ipadx = 500;
> gridBagConstraints.ipady = 10;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> getContentPane().add(jTextFieldNotes, gridBagConstraints);
>
> jButtonOk.setMnemonic('O');
> jButtonOk.setText("Ok");
> jButtonOk.setSelected(true);
> jButtonOk.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> jButtonOkActionPerformed(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 6;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> getContentPane().add(jButtonOk, gridBagConstraints);
>
> cancle.setMnemonic('C');
> cancle.setText("Cancel");
> cancle.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> cancleActionPerformed(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 5;
> gridBagConstraints.gridy = 6;
> gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
> gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> getContentPane().add(cancle, gridBagConstraints);
>
> prijLabel.setDisplayedMnemonic('r');
> prijLabel.setFont(new java.awt.Font("Dialog", 0, 14));
> prijLabel.setLabelFor(priComboBox);
> prijLabel.setText("Priority ");
> prijLabel.setName("Add Call");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 2;
> gridBagConstraints.gridy = 3;
> gridBagConstraints.gridwidth = 2;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> getContentPane().add(prijLabel, gridBagConstraints);
>
> priComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> priComboBoxMouseWheelMoved(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 4;
> gridBagConstraints.gridy = 3;
> gridBagConstraints.gridwidth = 2;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> getContentPane().add(priComboBox, gridBagConstraints);
>
> forjLabel.setDisplayedMnemonic('F');
> forjLabel.setFont(new java.awt.Font("Dialog", 0, 14));
> forjLabel.setLabelFor(jComboBoxFor);
> forjLabel.setText("For");
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 0;
> gridBagConstraints.gridy = 4;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> getContentPane().add(forjLabel, gridBagConstraints);
>
> jComboBoxFor.addMouseListener(new java.awt.event.MouseAdapter() {
> public void mouseReleased(java.awt.event.MouseEvent evt) {
> jComboBoxForMouseReleased(evt);
> }
> });
>
> jComboBoxFor.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> jComboBoxForMouseWheelMoved(evt);
> }
> });
>
> jComboBoxFor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
> public void propertyChange(java.beans.PropertyChangeEvent evt) {
> jComboBoxForPropertyChange(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 1;
> gridBagConstraints.gridy = 4;
> gridBagConstraints.gridwidth = 5;
> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> gridBagConstraints.ipadx = 260;
> gridBagConstraints.ipady = 5;
> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> getContentPane().add(jComboBoxFor, gridBagConstraints);
>
> jButtionJSwitch.setMnemonic('S');
> jButtionJSwitch.setText("Switch");
> jButtionJSwitch.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> jButtionJSwitchActionPerformed(evt);
> }
> });
>
> gridBagConstraints = new java.awt.GridBagConstraints();
> gridBagConstraints.gridx = 5;
> gridBagConstraints.gridy = 1;
> gridBagConstraints.gridheight = 2;
> gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> getContentPane().add(jButtionJSwitch, gridBagConstraints);
>
> }//GEN-END:initComponents
>
> private void jTextFieldNotesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldNotesFocusGained
> // Add your handling code here:
> if(this.m_bfcall){
> this.jTextFieldNotes.setCaretPosition(this.jTextFieldNotes.g etText().length());
> } else this.setSelectTextAll(this.jTextFieldNotes);
> }//GEN-LAST:event_jTextFieldNotesFocusGained
>
> private void phone2JTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phone2JTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.phone2JTextField);
> }//GEN-LAST:event_phone2JTextFieldFocusGained
>
> private void nameJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_nameJTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.nameJTextField);
> }//GEN-LAST:event_nameJTextFieldFocusGained
>
> private void phoneJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phoneJTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.phoneJTextField);
> }//GEN-LAST:event_phoneJTextFieldFocusGained
> private static void setSelectTextAll(javax.swing.JTextField textField){
> textField.setSelectionStart(0);
> textField.setSelectionEnd(textField.getText().length());
> }
> private void jComboBoxForMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_jComboBoxForMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.jComboBoxFor);
> }//GEN-LAST:event_jComboBoxForMouseWheelMoved
>
> private void statusjComboBoxMouseWheelMoved(java.awt.event.MouseWheelEven t evt) {//GEN-FIRST:event_statusjComboBoxMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.statusjComboBox);
> }//GEN-LAST:event_statusjComboBoxMouseWheelMoved
>
> private void scrollWheelComboBox(java.awt.event.MouseWheelEvent evt, javax.swing.JComboBox cBox){
> int i_inc = +1;
> if(evt.getWheelRotation()<0) {i_inc=-1;}
> int pos=cBox.getSelectedIndex()+i_inc;
> if(pos>=cBox.getItemCount()) pos=0;
> if(pos<0) pos=cBox.getItemCount()-1;
> cBox.setSelectedIndex(pos);
> }
> private void priComboBoxMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_priComboBoxMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.priComboBox);
> }//GEN-LAST:event_priComboBoxMouseWheelMoved
>
> private void jComboBoxForMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxForMouseReleased
> // Add your handling code here:
> String user =(String)this.jComboBoxFor.getSelectedItem();
> if (user!=null) if (getStatusData(user)==0){
> System.err.println("not On Phone");
> }
> }//GEN-LAST:event_jComboBoxForMouseReleased
>
> private void jComboBoxForPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jComboBoxForPropertyChange
> // Add your handling code here:
> String user =(String)this.jComboBoxFor.getSelectedItem();
> if (user!=null) if (getStatusData(user)==0){
> new NotHereDLG(new javax.swing.JFrame(), true,user).show();
> }
> }//GEN-LAST:event_jComboBoxForPropertyChange
>
> private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
> // Add your handling code here:
> checkTextFieldLen(jTextFieldNotes,3998);
> checkTextFieldLen(phone2JTextField,39);
> checkTextFieldLen(phoneJTextField,39);
> checkTextFieldLen(nameJTextField,79);
> if(this.m_bfcall){
> this.priComboBox.setSelectedIndex(1);
> javax.swing.JOptionPane.showMessageDialog(this,"First Call");
> }
> }//GEN-LAST:event_formComponentShown
>
> private void jTextFieldNotesKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldNotesKeyTyped
> // Add your handling code here:
> checkTextFieldLen(jTextFieldNotes,3998);
> }//GEN-LAST:event_jTextFieldNotesKeyTyped
>
> private void phone2JTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phone2JTextFieldKeyTyped
> // Add your handling code here:
> checkTextFieldLen(phone2JTextField,39);
> }//GEN-LAST:event_phone2JTextFieldKeyTyped
>
> private void phoneJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phoneJTextFieldKeyTyped
> checkTextFieldLen(phoneJTextField,39);
> // Add your handling code here:
> }//GEN-LAST:event_phoneJTextFieldKeyTyped
>
> private void nameJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nameJTextFieldKeyTyped
> // Add your handling code here:
> checkTextFieldLen(nameJTextField,79);
> }//GEN-LAST:event_nameJTextFieldKeyTyped
>
> private void jButtionJSwitchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtionJSwitchActionPerformed
> // Add your handling code here:
> switch(i_switch){
> case 0:
> i_switch++;
> phoneJTextField.setText(m_phone2);
> phone2JTextField.setText(m_phone);
> break;
> case 1:
> i_switch++;
> phoneJTextField.setText("");
> phone2JTextField.setText(m_phone);
> phoneJTextField.requestFocus();
> break;
> default :
> i_switch=0;
> phoneJTextField.setText(m_phone);
> phone2JTextField.setText(m_phone2);
> }
> }//GEN-LAST:event_jButtionJSwitchActionPerformed
> private void checkTextFieldLen(javax.swing.JTextField f, int size){
> String text= f.getText();
> if(text.length()>size){
> text=text.substring(0,size);
> f.setText(text);
> }
> }
> private void cancleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancleActionPerformed
> // Add your handling code here:
> setVisible(false);
> dispose();
> }//GEN-LAST:event_cancleActionPerformed
>
> private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
> // Add your handling code here:
> this.m_bOkay=true;
> m_oPhoneCall.setPhoneCall( nameJTextField.getText(), phoneJTextField.getText(), phone2JTextField.getText(),"", jComboBoxFor.getSelectedItem().toString() ,jTextFieldNotes.getText(),priComboBox.getSelectedItem().toS tring(),statusjComboBox.getSelectedItem().toString(),m_oDB);
> setVisible(false);
> }//GEN-LAST:event_jButtonOkActionPerformed
>
> private void statusjComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_statusjComboBoxActionPerformed
> // Add your handling code here:
> }//GEN-LAST:event_statusjComboBoxActionPerformed
>
> /** Closes the dialog */
> private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
> setVisible(false);
> dispose();
> }//GEN-LAST:event_closeDialog
>
> /**
> * @param args the command line arguments
> */
> public static void main(String args[]) {
> //new AddCallDLG (new javax.swing.JFrame (), true).show ();
> }
>
> public void setPriList(String [] p_saList) {
> for(int i=0;i<p_saList.length;i++){
> this.priComboBox.addItem(makeObj(p_saList[i]));
>
> }
> }
>
> public void setStatusList(String [] p_saList) {
> for(int i=0;i<p_saList.length;i++){
> this.statusjComboBox.addItem(makeObj(p_saList[i]));
> }
> }
>
>
> public void setCallerListName(String name){
> int inx=this.jComboBoxFor.getItemCount()-1;
> while (inx>0 && ((String)this.jComboBoxFor.getItemAt(inx)).equalsIgnoreCase( name)== false){
> inx--;
> }
> this.jComboBoxFor.setSelectedIndex(inx);
> }
>
> public void setCallerList(ArrayList p_saList) {
> for(int i=0;i<p_saList.size();i++){
> this.jComboBoxFor.addItem(p_saList.get(i));
> }
> }
>
> public PhoneCall getPhoneCall(){
> //public PhoneCall(String p_sCaller, String p_sPhone, String p_sPhone2, String p_sQedBy, String p_sFor, String p_sNotes, String p_sPri,String p_sStatus)
> PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(), "",(String)jComboBoxFor.getSelectedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
> return (pcall);
> }
> public PhoneCall getPhoneCall(String UserID){
> PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(),UserID,(String)jComboBoxFor.getS electedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
> return (pcall);
> }
>
> private Object makeObj(final String item) {
> return new Object() { public String toString() { return item; } };
> }
>
> public void setCustInfo(String name, String phone, String phone2, String accountno){
> nameJTextField.setText(name);
> phoneJTextField.setText(phone);
> m_phone=phone;
> phone2JTextField.setText(phone2);
> m_phone2=phone2;
> this.m_sAccountNO=accountno;
> if(this.m_oPhoneCall.isFirstCall(m_oDB,name)){
> System.err.println("FirstCall");
> this.jTextFieldNotes.setText("First Call:");
> this.m_bfcall=true;
> } else System.err.println("not F call");
> }
>
> public void setCallList(javax.swing.JList p_list){
> m_oCallList=p_list;
> }
>
> // Variables declaration - do not modify//GEN-BEGIN:variables
> private javax.swing.JLabel jLabel4;
> private javax.swing.JTextField phone2JTextField;
> private javax.swing.JLabel jLabel1;
> private javax.swing.JLabel jLabel3;
> private javax.swing.JTextField phoneJTextField;
> private javax.swing.JLabel jLabel2;
> private javax.swing.JLabel prijLabel;
> private javax.swing.JComboBox statusjComboBox;
> private javax.swing.JButton cancle;
> private javax.swing.JTextField jTextFieldNotes;
> private javax.swing.JButton jButtonOk;
> private javax.swing.JTextField nameJTextField;
> private javax.swing.JButton jButtionJSwitch;
> private javax.swing.JComboBox priComboBox;
> private javax.swing.JComboBox jComboBoxFor;
> private javax.swing.JLabel forjLabel;
> private javax.swing.JLabel jLabel5;
> // End of variables declaration//GEN-END:variables
>
> }




--------------010807050909080305090803
Content-Type: text/java;
name="AddCallDLG.java"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="AddCallDLG.java"

/*
* AddCallDLG.java
*
* Created on July 16, 2001, 1:57 PM
*/


/**
*
* @author david
* @version
*/
/* Todo
* Make it so you pass a Phone call to the dialog and it fills it in fo you.
*
**/
import javax.swing.JComboBox;
import java.util.ArrayList;

public class AddCallDLG extends javax.swing.JDialog {
private ErrorLogging m_oErrLog;
private int i_switch=0;
String m_sAccountNO;
private String m_phone, m_phone2;
boolean m_bOkay=false;
private boolean m_bfcall=false;
javax.swing.JList m_oCallList;
private PhoneCall m_oPhoneCall;
private MyDataBase m_oDB;
/** Creates new form AddCallDLG */

public AddCallDLG(PhoneMainFrame parent,boolean modal,PhoneCall p_phone,ErrorLogging errorlog) {
super(parent, modal);
//PhoneMainFrame mf = (PhoneMainFrame) parent;
m_oDB=parent.o_SqlConnection;
m_oErrLog=errorlog;
m_oPhoneCall=p_phone;
initComponents();
pack();
}

public int getStatusData(String name){
int retval=0;
try{
java.sql.Statement stmt = m_oDB.m_sqlConnection.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("Select * FROM phonegroups WHERE pgroup = '"+name+"'");
PhoneUser t_phoneuser=null;
//create an ArrayList of PhoneCalls
if (rs.next()){
retval=1;
}
else {
rs = stmt.executeQuery("Select * FROM phoneusers WHERE username= '"+name+"'");
//create an ArrayList of PhoneCalls
if (rs.next()){
t_phoneuser = new PhoneUser(m_oDB,rs);
retval=t_phoneuser.getUserStatus();
}

}
} catch (Exception ex){
// TODO Add more errorchecking code here.
System.err.println(ex.toString());

}
return retval;
}
/** 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 FormEditor.
*/
private void initComponents() {//GEN-BEGIN:initComponents
// java.awt.GridBagConstraints gridBagConstraints; VE requires distinct constraints

jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
nameJTextField = new javax.swing.JTextField();
phoneJTextField = new javax.swing.JTextField();
phone2JTextField = new javax.swing.JTextField();
statusjComboBox = new javax.swing.JComboBox();
jTextFieldNotes = new javax.swing.JTextField();
jButtonOk = new javax.swing.JButton();
cancle = new javax.swing.JButton();
prijLabel = new javax.swing.JLabel();
priComboBox = new javax.swing.JComboBox();
forjLabel = new javax.swing.JLabel();
jComboBoxFor = new javax.swing.JComboBox();
jButtionJSwitch = new javax.swing.JButton();

jDialogContentPane = new javax.swing.JPanel() ; // Explicit content pane
setContentPane(jDialogContentPane);
jDialogContentPane.setLayout(new java.awt.GridBagLayout());

setTitle("Add a Call");
addComponentListener(new java.awt.event.ComponentAdapter() {
public void componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}
});

addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
closeDialog(evt);
}
});

jLabel1.setDisplayedMnemonic('N');
jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel1.setLabelFor(nameJTextField);
jLabel1.setText("Name");
java.awt.GridBagConstraints l1gridBagConstraints = new java.awt.GridBagConstraints();
l1gridBagConstraints.gridx = 0;
l1gridBagConstraints.gridy = 0;
l1gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
l1gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(jLabel1, l1gridBagConstraints);

jLabel2.setDisplayedMnemonic('P');
jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel2.setLabelFor(phoneJTextField);
jLabel2.setText("Phone");
java.awt.GridBagConstraints l2gridBagConstraints = new java.awt.GridBagConstraints();
l2gridBagConstraints.gridx = 0;
l2gridBagConstraints.gridy = 1;
l2gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
l2gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(jLabel2, l2gridBagConstraints);

jLabel3.setDisplayedMnemonic('2');
jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel3.setLabelFor(phone2JTextField);
jLabel3.setText("Phone2");
java.awt.GridBagConstraints l3gridBagConstraints = new java.awt.GridBagConstraints();
l3gridBagConstraints.gridx = 0;
l3gridBagConstraints.gridy = 2;
l3gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
l3gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(jLabel3, l3gridBagConstraints);

jLabel4.setDisplayedMnemonic('a');
jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel4.setLabelFor(statusjComboBox);
jLabel4.setText("Status");
java.awt.GridBagConstraints l4gridBagConstraints = new java.awt.GridBagConstraints();
l4gridBagConstraints.gridx = 0;
l4gridBagConstraints.gridy = 3;
l4gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
l4gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(jLabel4, l4gridBagConstraints);

jLabel5.setDisplayedMnemonic('t');
jLabel5.setFont(new java.awt.Font("Dialog", 0, 14));
jLabel5.setLabelFor(jTextFieldNotes);
jLabel5.setText("Note");
java.awt.GridBagConstraints l5gridBagConstraints = new java.awt.GridBagConstraints();
l5gridBagConstraints.gridx = 0;
l5gridBagConstraints.gridy = 5;
l5gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
l5gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(jLabel5, l5gridBagConstraints);

nameJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
nameJTextFieldFocusGained(evt);
}
});

nameJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
nameJTextFieldKeyTyped(evt);
}
});

java.awt.GridBagConstraints ntfgridBagConstraints = new java.awt.GridBagConstraints();
ntfgridBagConstraints.gridx = 1;
ntfgridBagConstraints.gridy = 0;
ntfgridBagConstraints.gridwidth = 5;
ntfgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
ntfgridBagConstraints.ipadx = 396;
ntfgridBagConstraints.ipady = 10;
ntfgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
jDialogContentPane.add(nameJTextField, ntfgridBagConstraints);

phoneJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
phoneJTextFieldFocusGained(evt);
}
});

phoneJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
phoneJTextFieldKeyTyped(evt);
}
});

java.awt.GridBagConstraints ptfgridBagConstraints = new java.awt.GridBagConstraints();
ptfgridBagConstraints.gridx = 1;
ptfgridBagConstraints.gridy = 1;
ptfgridBagConstraints.gridwidth = 4;
ptfgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
ptfgridBagConstraints.ipadx = 396;
ptfgridBagConstraints.ipady = 10;
ptfgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
jDialogContentPane.add(phoneJTextField, ptfgridBagConstraints);

phone2JTextField.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
phone2JTextFieldFocusGained(evt);
}
});

phone2JTextField.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
phone2JTextFieldKeyTyped(evt);
}
});

java.awt.GridBagConstraints ptf2gridBagConstraints = new java.awt.GridBagConstraints();
ptf2gridBagConstraints.gridx = 1;
ptf2gridBagConstraints.gridy = 2;
ptf2gridBagConstraints.gridwidth = 4;
ptf2gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
ptf2gridBagConstraints.ipadx = 396;
ptf2gridBagConstraints.ipady = 10;
ptf2gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
jDialogContentPane.add(phone2JTextField, ptf2gridBagConstraints);

statusjComboBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
statusjComboBoxActionPerformed(evt);
}
});

statusjComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
statusjComboBoxMouseWheelMoved(evt);
}
});

java.awt.GridBagConstraints statgridBagConstraints = new java.awt.GridBagConstraints();
statgridBagConstraints.gridx = 1;
statgridBagConstraints.gridy = 3;
statgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
statgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
jDialogContentPane.add(statusjComboBox, statgridBagConstraints);

jTextFieldNotes.addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
jTextFieldNotesFocusGained(evt);
}
});

jTextFieldNotes.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jTextFieldNotesKeyTyped(evt);
}
});

java.awt.GridBagConstraints ngridBagConstraints = new java.awt.GridBagConstraints();
ngridBagConstraints.gridx = 1;
ngridBagConstraints.gridy = 5;
ngridBagConstraints.gridwidth = 5;
ngridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
ngridBagConstraints.ipadx = 500;
ngridBagConstraints.ipady = 10;
ngridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
jDialogContentPane.add(jTextFieldNotes, ngridBagConstraints);

jButtonOk.setMnemonic('O');
jButtonOk.setText("Ok");
jButtonOk.setSelected(true);
jButtonOk.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtonOkActionPerformed(evt);
}
});

java.awt.GridBagConstraints okgridBagConstraints = new java.awt.GridBagConstraints();
okgridBagConstraints.gridx = 1;
okgridBagConstraints.gridy = 6;
okgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
okgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
jDialogContentPane.add(jButtonOk, okgridBagConstraints);

cancle.setMnemonic('C');
cancle.setText("Cancel");
cancle.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cancleActionPerformed(evt);
}
});

java.awt.GridBagConstraints cancelgridBagConstraints = new java.awt.GridBagConstraints();
cancelgridBagConstraints.gridx = 5;
cancelgridBagConstraints.gridy = 6;
cancelgridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
cancelgridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
cancelgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
jDialogContentPane.add(cancle, cancelgridBagConstraints);

prijLabel.setDisplayedMnemonic('r');
prijLabel.setFont(new java.awt.Font("Dialog", 0, 14));
prijLabel.setLabelFor(priComboBox);
prijLabel.setText("Priority ");
prijLabel.setName("Add Call");
java.awt.GridBagConstraints prigridBagConstraints = new java.awt.GridBagConstraints();
prigridBagConstraints.gridx = 2;
prigridBagConstraints.gridy = 3;
prigridBagConstraints.gridwidth = 2;
prigridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
jDialogContentPane.add(prijLabel, prigridBagConstraints);

priComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
priComboBoxMouseWheelMoved(evt);
}
});

java.awt.GridBagConstraints pricbgridBagConstraints = new java.awt.GridBagConstraints();
pricbgridBagConstraints.gridx = 4;
pricbgridBagConstraints.gridy = 3;
pricbgridBagConstraints.gridwidth = 2;
pricbgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
pricbgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
jDialogContentPane.add(priComboBox, pricbgridBagConstraints);

forjLabel.setDisplayedMnemonic('F');
forjLabel.setFont(new java.awt.Font("Dialog", 0, 14));
forjLabel.setLabelFor(jComboBoxFor);
forjLabel.setText("For");
java.awt.GridBagConstraints lgridBagConstraints = new java.awt.GridBagConstraints();
lgridBagConstraints.gridx = 0;
lgridBagConstraints.gridy = 4;
lgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
lgridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
jDialogContentPane.add(forjLabel, lgridBagConstraints);

jComboBoxFor.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseReleased(java.awt.event.MouseEvent evt) {
jComboBoxForMouseReleased(evt);
}
});

jComboBoxFor.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
jComboBoxForMouseWheelMoved(evt);
}
});

jComboBoxFor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
jComboBoxForPropertyChange(evt);
}
});

java.awt.GridBagConstraints forgridBagConstraints = new java.awt.GridBagConstraints();
forgridBagConstraints.gridx = 1;
forgridBagConstraints.gridy = 4;
forgridBagConstraints.gridwidth = 5;
forgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
forgridBagConstraints.ipadx = 260;
forgridBagConstraints.ipady = 5;
forgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
jDialogContentPane.add(jComboBoxFor, forgridBagConstraints);

jButtionJSwitch.setMnemonic('S');
jButtionJSwitch.setText("Switch");
jButtionJSwitch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButtionJSwitchActionPerformed(evt);
}
});

java.awt.GridBagConstraints sgridBagConstraints = new java.awt.GridBagConstraints();
sgridBagConstraints.gridx = 5;
sgridBagConstraints.gridy = 1;
sgridBagConstraints.gridheight = 2;
sgridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
sgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
jDialogContentPane.add(jButtionJSwitch, sgridBagConstraints);

}//GEN-END:initComponents

private void jTextFieldNotesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldNotesFocusGained
// Add your handling code here:
if(this.m_bfcall){
this.jTextFieldNotes.setCaretPosition(this.jTextFieldNotes.g etText().length());
} else this.setSelectTextAll(this.jTextFieldNotes);
}//GEN-LAST:event_jTextFieldNotesFocusGained

private void phone2JTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phone2JTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.phone2JTextField);
}//GEN-LAST:event_phone2JTextFieldFocusGained

private void nameJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_nameJTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.nameJTextField);
}//GEN-LAST:event_nameJTextFieldFocusGained

private void phoneJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phoneJTextFieldFocusGained
// Add your handling code here:
this.setSelectTextAll(this.phoneJTextField);
}//GEN-LAST:event_phoneJTextFieldFocusGained
private static void setSelectTextAll(javax.swing.JTextField textField){
textField.setSelectionStart(0);
textField.setSelectionEnd(textField.getText().length());
}
private void jComboBoxForMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_jComboBoxForMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.jComboBoxFor);
}//GEN-LAST:event_jComboBoxForMouseWheelMoved

private void statusjComboBoxMouseWheelMoved(java.awt.event.MouseWheelEven t evt) {//GEN-FIRST:event_statusjComboBoxMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.statusjComboBox);
}//GEN-LAST:event_statusjComboBoxMouseWheelMoved

private void scrollWheelComboBox(java.awt.event.MouseWheelEvent evt, javax.swing.JComboBox cBox){
int i_inc = +1;
if(evt.getWheelRotation()<0) {i_inc=-1;}
int pos=cBox.getSelectedIndex()+i_inc;
if(pos>=cBox.getItemCount()) pos=0;
if(pos<0) pos=cBox.getItemCount()-1;
cBox.setSelectedIndex(pos);
}
private void priComboBoxMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_priComboBoxMouseWheelMoved
// Add your handling code here:
this.scrollWheelComboBox(evt, this.priComboBox);
}//GEN-LAST:event_priComboBoxMouseWheelMoved

private void jComboBoxForMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxForMouseReleased
// Add your handling code here:
String user =(String)this.jComboBoxFor.getSelectedItem();
if (user!=null) if (getStatusData(user)==0){
System.err.println("not On Phone");
}
}//GEN-LAST:event_jComboBoxForMouseReleased

private void jComboBoxForPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jComboBoxForPropertyChange
// Add your handling code here:
String user =(String)this.jComboBoxFor.getSelectedItem();
if (user!=null) if (getStatusData(user)==0){
new NotHereDLG(new javax.swing.JFrame(), true,user).show();
}
}//GEN-LAST:event_jComboBoxForPropertyChange

private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
// Add your handling code here:
checkTextFieldLen(jTextFieldNotes,3998);
checkTextFieldLen(phone2JTextField,39);
checkTextFieldLen(phoneJTextField,39);
checkTextFieldLen(nameJTextField,79);
if(this.m_bfcall){
this.priComboBox.setSelectedIndex(1);
javax.swing.JOptionPane.showMessageDialog(this,"First Call");
}
}//GEN-LAST:event_formComponentShown

private void jTextFieldNotesKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldNotesKeyTyped
// Add your handling code here:
checkTextFieldLen(jTextFieldNotes,3998);
}//GEN-LAST:event_jTextFieldNotesKeyTyped

private void phone2JTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phone2JTextFieldKeyTyped
// Add your handling code here:
checkTextFieldLen(phone2JTextField,39);
}//GEN-LAST:event_phone2JTextFieldKeyTyped

private void phoneJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phoneJTextFieldKeyTyped
checkTextFieldLen(phoneJTextField,39);
// Add your handling code here:
}//GEN-LAST:event_phoneJTextFieldKeyTyped

private void nameJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nameJTextFieldKeyTyped
// Add your handling code here:
checkTextFieldLen(nameJTextField,79);
}//GEN-LAST:event_nameJTextFieldKeyTyped

private void jButtionJSwitchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtionJSwitchActionPerformed
// Add your handling code here:
switch(i_switch){
case 0:
i_switch++;
phoneJTextField.setText(m_phone2);
phone2JTextField.setText(m_phone);
break;
case 1:
i_switch++;
phoneJTextField.setText("");
phone2JTextField.setText(m_phone);
phoneJTextField.requestFocus();
break;
default :
i_switch=0;
phoneJTextField.setText(m_phone);
phone2JTextField.setText(m_phone2);
}
}//GEN-LAST:event_jButtionJSwitchActionPerformed
private void checkTextFieldLen(javax.swing.JTextField f, int size){
String text= f.getText();
if(text.length()>size){
text=text.substring(0,size);
f.setText(text);
}
}
private void cancleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancleActionPerformed
// Add your handling code here:
setVisible(false);
dispose();
}//GEN-LAST:event_cancleActionPerformed

private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
// Add your handling code here:
this.m_bOkay=true;
m_oPhoneCall.setPhoneCall( nameJTextField.getText(), phoneJTextField.getText(), phone2JTextField.getText(),"", jComboBoxFor.getSelectedItem().toString() ,jTextFieldNotes.getText(),priComboBox.getSelectedItem().toS tring(),statusjComboBox.getSelectedItem().toString(),m_oDB);
setVisible(false);
}//GEN-LAST:event_jButtonOkActionPerformed

private void statusjComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_statusjComboBoxActionPerformed
// Add your handling code here:
}//GEN-LAST:event_statusjComboBoxActionPerformed

/** Closes the dialog */
private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
setVisible(false);
dispose();
}//GEN-LAST:event_closeDialog

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
//new AddCallDLG (new javax.swing.JFrame (), true).show ();
}

public void setPriList(String [] p_saList) {
for(int i=0;i<p_saList.length;i++){
this.priComboBox.addItem(makeObj(p_saList[i]));

}
}

public void setStatusList(String [] p_saList) {
for(int i=0;i<p_saList.length;i++){
this.statusjComboBox.addItem(makeObj(p_saList[i]));
}
}


public void setCallerListName(String name){
int inx=this.jComboBoxFor.getItemCount()-1;
while (inx>0 && ((String)this.jComboBoxFor.getItemAt(inx)).equalsIgnoreCase( name)== false){
inx--;
}
this.jComboBoxFor.setSelectedIndex(inx);
}

public void setCallerList(ArrayList p_saList) {
for(int i=0;i<p_saList.size();i++){
this.jComboBoxFor.addItem(p_saList.get(i));
}
}

public PhoneCall getPhoneCall(){
//public PhoneCall(String p_sCaller, String p_sPhone, String p_sPhone2, String p_sQedBy, String p_sFor, String p_sNotes, String p_sPri,String p_sStatus)
PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(), "",(String)jComboBoxFor.getSelectedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
return (pcall);
}
public PhoneCall getPhoneCall(String UserID){
PhoneCall pcall= new PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField..getText(),UserID,(String)jComboBoxFor.get SelectedItem(), jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
return (pcall);
}

private Object makeObj(final String item) {
return new Object() { public String toString() { return item; } };
}

public void setCustInfo(String name, String phone, String phone2, String accountno){
nameJTextField.setText(name);
phoneJTextField.setText(phone);
m_phone=phone;
phone2JTextField.setText(phone2);
m_phone2=phone2;
this.m_sAccountNO=accountno;
if(this.m_oPhoneCall.isFirstCall(m_oDB,name)){
System.err.println("FirstCall");
this.jTextFieldNotes.setText("First Call:");
this.m_bfcall=true;
} else System.err.println("not F call");
}

public void setCallList(javax.swing.JList p_list){
m_oCallList=p_list;
}

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField phone2JTextField;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField phoneJTextField;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel prijLabel;
private javax.swing.JComboBox statusjComboBox;
private javax.swing.JButton cancle;
private javax.swing.JTextField jTextFieldNotes;
private javax.swing.JButton jButtonOk;
private javax.swing.JTextField nameJTextField;
private javax.swing.JButton jButtionJSwitch;
private javax.swing.JComboBox priComboBox;
private javax.swing.JComboBox jComboBoxFor;
private javax.swing.JLabel forjLabel;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jDialogContentPane; // VE does not support implicit components at this time
// End of variables declaration//GEN-END:variables

}
--------------010807050909080305090803
Content-Type: image/jpeg;
name="dialog.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="dialog.jpg"

/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcH Bw8LCwkMEQ8S
EhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcG Bw4ICA4eFBEU
Hh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e Hh4eHh7/wAAR
CAJXAz4DASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcI CQoL/8QAtRAA
AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS 0fAkM2JyggkK
FhcYGRolJicoKSo0NTY3ODk6Q0R
Re: VE importing NetBeans [message #572811 is a reply to message #8516] Mon, 08 December 2003 16:16 Go to previous message
Eclipse UserFriend
Originally posted by: david.eclipsecat.com

Gili Mendel wrote:
> There are two pattern issues that inhibits VE to parse this code properly:
>
> 1. implicit content pane. VE requires (in this version) to explicitly
> declare a content pane.
>
> 2. When using GridBag constraints, you will have to declare a unique
> constraint for each component you are adding ... the code above reuse
> the same variable (yet still allocate a new one).
>
> I modified the code by hand, so that you can diff the files. Note that
> there are many compile errors in the file, as this code reference
> classes that are not available. The beauty of VE is that compile errors
> that are not relevant are ignored.
>
> David Siebert wrote:
>
>> Here is the file I tried to export.
>> So far I find Eclipse to be pretty good. The Perl plugin seems to work
>> well. VE seems like it is a pretty nice piece of work but I have only
>> really just started to play with Eclipse. I have added two new
>> features to one of my programs today so I would say I am off to a good
>> start.
>>
>>
>> ------------------------------------------------------------ ------------
>>
>> /*
>> * AddCallDLG.java
>> *
>> * Created on July 16, 2001, 1:57 PM
>> */
>>
>>
>> /**
>> *
>> * @author david
>> * @version
>> */
>> /* Todo
>> * Make it so you pass a Phone call to the dialog and it fills it in
>> fo you.
>> *
>> **/
>> import javax.swing.JComboBox;
>> import java.util.ArrayList;
>>
>> public class AddCallDLG extends javax.swing.JDialog {
>> private ErrorLogging m_oErrLog;
>> private int i_switch=0;
>> String m_sAccountNO;
>> private String m_phone, m_phone2;
>> boolean m_bOkay=false;
>> private boolean m_bfcall=false;
>> javax.swing.JList m_oCallList;
>> private PhoneCall m_oPhoneCall;
>> private MyDataBase m_oDB;
>> /** Creates new form AddCallDLG */
>> public AddCallDLG(PhoneMainFrame parent,boolean
>> modal,PhoneCall p_phone,ErrorLogging errorlog) {
>> super(parent, modal);
>> //PhoneMainFrame mf = (PhoneMainFrame) parent;
>> m_oDB=parent.o_SqlConnection;
>> m_oErrLog=errorlog;
>> m_oPhoneCall=p_phone;
>> initComponents();
>> pack();
>> }
>> public int getStatusData(String name){
>> int retval=0;
>> try{
>> java.sql.Statement stmt =
>> m_oDB.m_sqlConnection.createStatement();
>> java.sql.ResultSet rs = stmt.executeQuery("Select * FROM
>> phonegroups WHERE pgroup = '"+name+"'");
>> PhoneUser t_phoneuser=null;
>> //create an ArrayList of PhoneCalls
>> if (rs.next()){
>> retval=1;
>> }
>> else {
>> rs = stmt.executeQuery("Select * FROM phoneusers WHERE
>> username= '"+name+"'");
>> //create an ArrayList of PhoneCalls
>> if (rs.next()){
>> t_phoneuser = new PhoneUser(m_oDB,rs);
>> retval=t_phoneuser.getUserStatus();
>> }
>> }
>> } catch (Exception ex){
>> // TODO Add more errorchecking code here.
>> System.err.println(ex.toString());
>> }
>> return retval;
>> }
>> /** 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 FormEditor.
>> */
>> private void initComponents() {//GEN-BEGIN:initComponents
>> java.awt.GridBagConstraints gridBagConstraints;
>>
>> jLabel1 = new javax.swing.JLabel();
>> jLabel2 = new javax.swing.JLabel();
>> jLabel3 = new javax.swing.JLabel();
>> jLabel4 = new javax.swing.JLabel();
>> jLabel5 = new javax.swing.JLabel();
>> nameJTextField = new javax.swing.JTextField();
>> phoneJTextField = new javax.swing.JTextField();
>> phone2JTextField = new javax.swing.JTextField();
>> statusjComboBox = new javax.swing.JComboBox();
>> jTextFieldNotes = new javax.swing.JTextField();
>> jButtonOk = new javax.swing.JButton();
>> cancle = new javax.swing.JButton();
>> prijLabel = new javax.swing.JLabel();
>> priComboBox = new javax.swing.JComboBox();
>> forjLabel = new javax.swing.JLabel();
>> jComboBoxFor = new javax.swing.JComboBox();
>> jButtionJSwitch = new javax.swing.JButton();
>>
>> getContentPane().setLayout(new java.awt.GridBagLayout());
>>
>> setTitle("Add a Call");
>> addComponentListener(new java.awt.event.ComponentAdapter() {
>> public void componentShown(java.awt.event.ComponentEvent
>> evt) {
>> formComponentShown(evt);
>> }
>> });
>>
>> addWindowListener(new java.awt.event.WindowAdapter() {
>> public void windowClosing(java.awt.event.WindowEvent evt) {
>> closeDialog(evt);
>> }
>> });
>>
>> jLabel1.setDisplayedMnemonic('N');
>> jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
>> jLabel1.setLabelFor(nameJTextField);
>> jLabel1.setText("Name");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 0;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(jLabel1, gridBagConstraints);
>>
>> jLabel2.setDisplayedMnemonic('P');
>> jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));
>> jLabel2.setLabelFor(phoneJTextField);
>> jLabel2.setText("Phone");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 1;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(jLabel2, gridBagConstraints);
>>
>> jLabel3.setDisplayedMnemonic('2');
>> jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));
>> jLabel3.setLabelFor(phone2JTextField);
>> jLabel3.setText("Phone2");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 2;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(jLabel3, gridBagConstraints);
>>
>> jLabel4.setDisplayedMnemonic('a');
>> jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));
>> jLabel4.setLabelFor(statusjComboBox);
>> jLabel4.setText("Status");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 3;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(jLabel4, gridBagConstraints);
>>
>> jLabel5.setDisplayedMnemonic('t');
>> jLabel5.setFont(new java.awt.Font("Dialog", 0, 14));
>> jLabel5.setLabelFor(jTextFieldNotes);
>> jLabel5.setText("Note");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 5;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(jLabel5, gridBagConstraints);
>>
>> nameJTextField.addFocusListener(new
>> java.awt.event.FocusAdapter() {
>> public void focusGained(java.awt.event.FocusEvent evt) {
>> nameJTextFieldFocusGained(evt);
>> }
>> });
>>
>> nameJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
>> public void keyTyped(java.awt.event.KeyEvent evt) {
>> nameJTextFieldKeyTyped(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 0;
>> gridBagConstraints.gridwidth = 5;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.ipadx = 396;
>> gridBagConstraints.ipady = 10;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
>> getContentPane().add(nameJTextField, gridBagConstraints);
>>
>> phoneJTextField.addFocusListener(new
>> java.awt.event.FocusAdapter() {
>> public void focusGained(java.awt.event.FocusEvent evt) {
>> phoneJTextFieldFocusGained(evt);
>> }
>> });
>>
>> phoneJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
>> public void keyTyped(java.awt.event.KeyEvent evt) {
>> phoneJTextFieldKeyTyped(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 1;
>> gridBagConstraints.gridwidth = 4;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.ipadx = 396;
>> gridBagConstraints.ipady = 10;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
>> getContentPane().add(phoneJTextField, gridBagConstraints);
>>
>> phone2JTextField.addFocusListener(new
>> java.awt.event.FocusAdapter() {
>> public void focusGained(java.awt.event.FocusEvent evt) {
>> phone2JTextFieldFocusGained(evt);
>> }
>> });
>>
>> phone2JTextField.addKeyListener(new java.awt.event.KeyAdapter() {
>> public void keyTyped(java.awt.event.KeyEvent evt) {
>> phone2JTextFieldKeyTyped(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 2;
>> gridBagConstraints.gridwidth = 4;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.ipadx = 396;
>> gridBagConstraints.ipady = 10;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
>> getContentPane().add(phone2JTextField, gridBagConstraints);
>>
>> statusjComboBox.addActionListener(new
>> java.awt.event.ActionListener() {
>> public void actionPerformed(java.awt.event.ActionEvent evt) {
>> statusjComboBoxActionPerformed(evt);
>> }
>> });
>>
>> statusjComboBox.addMouseWheelListener(new
>> java.awt.event.MouseWheelListener() {
>> public void mouseWheelMoved(java.awt.event.MouseWheelEvent
>> evt) {
>> statusjComboBoxMouseWheelMoved(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 3;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
>> getContentPane().add(statusjComboBox, gridBagConstraints);
>>
>> jTextFieldNotes.addFocusListener(new
>> java.awt.event.FocusAdapter() {
>> public void focusGained(java.awt.event.FocusEvent evt) {
>> jTextFieldNotesFocusGained(evt);
>> }
>> });
>>
>> jTextFieldNotes.addKeyListener(new java.awt.event.KeyAdapter() {
>> public void keyTyped(java.awt.event.KeyEvent evt) {
>> jTextFieldNotesKeyTyped(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 5;
>> gridBagConstraints.gridwidth = 5;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.ipadx = 500;
>> gridBagConstraints.ipady = 10;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
>> getContentPane().add(jTextFieldNotes, gridBagConstraints);
>>
>> jButtonOk.setMnemonic('O');
>> jButtonOk.setText("Ok");
>> jButtonOk.setSelected(true);
>> jButtonOk.addActionListener(new java.awt.event.ActionListener() {
>> public void actionPerformed(java.awt.event.ActionEvent evt) {
>> jButtonOkActionPerformed(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 6;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
>> getContentPane().add(jButtonOk, gridBagConstraints);
>>
>> cancle.setMnemonic('C');
>> cancle.setText("Cancel");
>> cancle.addActionListener(new java.awt.event.ActionListener() {
>> public void actionPerformed(java.awt.event.ActionEvent evt) {
>> cancleActionPerformed(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 5;
>> gridBagConstraints.gridy = 6;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
>> gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
>> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
>> getContentPane().add(cancle, gridBagConstraints);
>>
>> prijLabel.setDisplayedMnemonic('r');
>> prijLabel.setFont(new java.awt.Font("Dialog", 0, 14));
>> prijLabel.setLabelFor(priComboBox);
>> prijLabel.setText("Priority ");
>> prijLabel.setName("Add Call");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 2;
>> gridBagConstraints.gridy = 3;
>> gridBagConstraints.gridwidth = 2;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> getContentPane().add(prijLabel, gridBagConstraints);
>>
>> priComboBox.addMouseWheelListener(new
>> java.awt.event.MouseWheelListener() {
>> public void mouseWheelMoved(java.awt.event.MouseWheelEvent
>> evt) {
>> priComboBoxMouseWheelMoved(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 4;
>> gridBagConstraints.gridy = 3;
>> gridBagConstraints.gridwidth = 2;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
>> getContentPane().add(priComboBox, gridBagConstraints);
>>
>> forjLabel.setDisplayedMnemonic('F');
>> forjLabel.setFont(new java.awt.Font("Dialog", 0, 14));
>> forjLabel.setLabelFor(jComboBoxFor);
>> forjLabel.setText("For");
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 0;
>> gridBagConstraints.gridy = 4;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
>> getContentPane().add(forjLabel, gridBagConstraints);
>>
>> jComboBoxFor.addMouseListener(new java.awt.event.MouseAdapter() {
>> public void mouseReleased(java.awt.event.MouseEvent evt) {
>> jComboBoxForMouseReleased(evt);
>> }
>> });
>>
>> jComboBoxFor.addMouseWheelListener(new
>> java.awt.event.MouseWheelListener() {
>> public void mouseWheelMoved(java.awt.event.MouseWheelEvent
>> evt) {
>> jComboBoxForMouseWheelMoved(evt);
>> }
>> });
>>
>> jComboBoxFor.addPropertyChangeListener(new
>> java.beans.PropertyChangeListener() {
>> public void propertyChange(java.beans.PropertyChangeEvent
>> evt) {
>> jComboBoxForPropertyChange(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 1;
>> gridBagConstraints.gridy = 4;
>> gridBagConstraints.gridwidth = 5;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
>> gridBagConstraints.ipadx = 260;
>> gridBagConstraints.ipady = 5;
>> gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
>> getContentPane().add(jComboBoxFor, gridBagConstraints);
>>
>> jButtionJSwitch.setMnemonic('S');
>> jButtionJSwitch.setText("Switch");
>> jButtionJSwitch.addActionListener(new
>> java.awt.event.ActionListener() {
>> public void actionPerformed(java.awt.event.ActionEvent evt) {
>> jButtionJSwitchActionPerformed(evt);
>> }
>> });
>>
>> gridBagConstraints = new java.awt.GridBagConstraints();
>> gridBagConstraints.gridx = 5;
>> gridBagConstraints.gridy = 1;
>> gridBagConstraints.gridheight = 2;
>> gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
>> gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
>> getContentPane().add(jButtionJSwitch, gridBagConstraints);
>>
>> }//GEN-END:initComponents
>> private void
>> jTextFieldNotesFocusGained(java.awt.event.FocusEvent evt)
>> {//GEN-FIRST:event_jTextFieldNotesFocusGained
>> // Add your handling code here:
>> if(this.m_bfcall){
>>
>> this.jTextFieldNotes.setCaretPosition(this.jTextFieldNotes.g etText().length());
>>
>> } else this.setSelectTextAll(this.jTextFieldNotes);
>> }//GEN-LAST:event_jTextFieldNotesFocusGained
>> private void
>> phone2JTextFieldFocusGained(java.awt.event.FocusEvent evt)
>> {//GEN-FIRST:event_phone2JTextFieldFocusGained
>> // Add your handling code here:
>> this.setSelectTextAll(this.phone2JTextField);
>> }//GEN-LAST:event_phone2JTextFieldFocusGained
>> private void
>> nameJTextFieldFocusGained(java.awt.event.FocusEvent evt)
>> {//GEN-FIRST:event_nameJTextFieldFocusGained
>> // Add your handling code here:
>> this.setSelectTextAll(this.nameJTextField);
>> }//GEN-LAST:event_nameJTextFieldFocusGained
>> private void
>> phoneJTextFieldFocusGained(java.awt.event.FocusEvent evt)
>> {//GEN-FIRST:event_phoneJTextFieldFocusGained
>> // Add your handling code here:
>> this.setSelectTextAll(this.phoneJTextField);
>> }//GEN-LAST:event_phoneJTextFieldFocusGained
>> private static void setSelectTextAll(javax.swing.JTextField
>> textField){
>> textField.setSelectionStart(0);
>> textField.setSelectionEnd(textField.getText().length());
>> }
>> private void
>> jComboBoxForMouseWheelMoved(java.awt.event.MouseWheelEvent evt)
>> {//GEN-FIRST:event_jComboBoxForMouseWheelMoved
>> // Add your handling code here:
>> this.scrollWheelComboBox(evt, this.jComboBoxFor);
>> }//GEN-LAST:event_jComboBoxForMouseWheelMoved
>> private void
>> statusjComboBoxMouseWheelMoved(java.awt.event.MouseWheelEven t evt)
>> {//GEN-FIRST:event_statusjComboBoxMouseWheelMoved
>> // Add your handling code here:
>> this.scrollWheelComboBox(evt, this.statusjComboBox);
>> }//GEN-LAST:event_statusjComboBoxMouseWheelMoved
>> private void
>> scrollWheelComboBox(java.awt.event.MouseWheelEvent evt,
>> javax.swing.JComboBox cBox){
>> int i_inc = +1;
>> if(evt.getWheelRotation()<0) {i_inc=-1;}
>> int pos=cBox.getSelectedIndex()+i_inc;
>> if(pos>=cBox.getItemCount()) pos=0;
>> if(pos<0) pos=cBox.getItemCount()-1;
>> cBox.setSelectedIndex(pos);
>> }
>> private void
>> priComboBoxMouseWheelMoved(java.awt.event.MouseWheelEvent evt)
>> {//GEN-FIRST:event_priComboBoxMouseWheelMoved
>> // Add your handling code here:
>> this.scrollWheelComboBox(evt, this.priComboBox);
>> }//GEN-LAST:event_priComboBoxMouseWheelMoved
>> private void
>> jComboBoxForMouseReleased(java.awt.event.MouseEvent evt)
>> {//GEN-FIRST:event_jComboBoxForMouseReleased
>> // Add your handling code here:
>> String user =(String)this.jComboBoxFor.getSelectedItem();
>> if (user!=null) if (getStatusData(user)==0){
>> System.err.println("not On Phone");
>> }
>> }//GEN-LAST:event_jComboBoxForMouseReleased
>> private void
>> jComboBoxForPropertyChange(java.beans.PropertyChangeEvent evt)
>> {//GEN-FIRST:event_jComboBoxForPropertyChange
>> // Add your handling code here:
>> String user =(String)this.jComboBoxFor.getSelectedItem();
>> if (user!=null) if (getStatusData(user)==0){
>> new NotHereDLG(new javax.swing.JFrame(), true,user).show();
>> }
>> }//GEN-LAST:event_jComboBoxForPropertyChange
>> private void formComponentShown(java.awt.event.ComponentEvent
>> evt) {//GEN-FIRST:event_formComponentShown
>> // Add your handling code here:
>> checkTextFieldLen(jTextFieldNotes,3998);
>> checkTextFieldLen(phone2JTextField,39);
>> checkTextFieldLen(phoneJTextField,39);
>> checkTextFieldLen(nameJTextField,79);
>> if(this.m_bfcall){
>> this.priComboBox.setSelectedIndex(1);
>> javax.swing.JOptionPane.showMessageDialog(this,"First Call");
>> }
>> }//GEN-LAST:event_formComponentShown
>> private void jTextFieldNotesKeyTyped(java.awt.event.KeyEvent
>> evt) {//GEN-FIRST:event_jTextFieldNotesKeyTyped
>> // Add your handling code here:
>> checkTextFieldLen(jTextFieldNotes,3998);
>> }//GEN-LAST:event_jTextFieldNotesKeyTyped
>> private void phone2JTextFieldKeyTyped(java.awt.event.KeyEvent
>> evt) {//GEN-FIRST:event_phone2JTextFieldKeyTyped
>> // Add your handling code here:
>> checkTextFieldLen(phone2JTextField,39);
>> }//GEN-LAST:event_phone2JTextFieldKeyTyped
>> private void phoneJTextFieldKeyTyped(java.awt.event.KeyEvent
>> evt) {//GEN-FIRST:event_phoneJTextFieldKeyTyped
>> checkTextFieldLen(phoneJTextField,39);
>> // Add your handling code here:
>> }//GEN-LAST:event_phoneJTextFieldKeyTyped
>> private void nameJTextFieldKeyTyped(java.awt.event.KeyEvent
>> evt) {//GEN-FIRST:event_nameJTextFieldKeyTyped
>> // Add your handling code here:
>> checkTextFieldLen(nameJTextField,79);
>> }//GEN-LAST:event_nameJTextFieldKeyTyped
>> private void
>> jButtionJSwitchActionPerformed(java.awt.event.ActionEvent evt)
>> {//GEN-FIRST:event_jButtionJSwitchActionPerformed
>> // Add your handling code here:
>> switch(i_switch){
>> case 0:
>> i_switch++;
>> phoneJTextField.setText(m_phone2);
>> phone2JTextField.setText(m_phone);
>> break;
>> case 1:
>> i_switch++;
>> phoneJTextField.setText("");
>> phone2JTextField.setText(m_phone);
>> phoneJTextField.requestFocus();
>> break;
>> default :
>> i_switch=0;
>> phoneJTextField.setText(m_phone);
>> phone2JTextField.setText(m_phone2);
>> }
>> }//GEN-LAST:event_jButtionJSwitchActionPerformed
>> private void checkTextFieldLen(javax.swing.JTextField f, int size){
>> String text= f.getText();
>> if(text.length()>size){
>> text=text.substring(0,size);
>> f.setText(text);
>> }
>> }
>> private void cancleActionPerformed(java.awt.event.ActionEvent evt)
>> {//GEN-FIRST:event_cancleActionPerformed
>> // Add your handling code here:
>> setVisible(false);
>> dispose();
>> }//GEN-LAST:event_cancleActionPerformed
>> private void jButtonOkActionPerformed(java.awt.event.ActionEvent
>> evt) {//GEN-FIRST:event_jButtonOkActionPerformed
>> // Add your handling code here:
>> this.m_bOkay=true;
>> m_oPhoneCall.setPhoneCall( nameJTextField.getText(),
>> phoneJTextField.getText(), phone2JTextField.getText(),"",
>> jComboBoxFor.getSelectedItem().toString()
>> ,jTextFieldNotes.getText(),priComboBox.getSelectedItem().toS tring(),statusjComboBox.getSelectedItem().toString(),m_oDB);
>>
>> setVisible(false);
>> }//GEN-LAST:event_jButtonOkActionPerformed
>> private void
>> statusjComboBoxActionPerformed(java.awt.event.ActionEvent evt)
>> {//GEN-FIRST:event_statusjComboBoxActionPerformed
>> // Add your handling code here:
>> }//GEN-LAST:event_statusjComboBoxActionPerformed
>> /** Closes the dialog */
>> private void closeDialog(java.awt.event.WindowEvent evt)
>> {//GEN-FIRST:event_closeDialog
>> setVisible(false);
>> dispose();
>> }//GEN-LAST:event_closeDialog
>> /**
>> * @param args the command line arguments
>> */
>> public static void main(String args[]) {
>> //new AddCallDLG (new javax.swing.JFrame (), true).show ();
>> }
>> public void setPriList(String [] p_saList) {
>> for(int i=0;i<p_saList.length;i++){
>> this.priComboBox.addItem(makeObj(p_saList[i]));
>> }
>> }
>> public void setStatusList(String [] p_saList) {
>> for(int i=0;i<p_saList.length;i++){
>> this.statusjComboBox.addItem(makeObj(p_saList[i]));
>> }
>> }
>> public void setCallerListName(String name){
>> int inx=this.jComboBoxFor.getItemCount()-1;
>> while (inx>0 &&
>> ((String)this.jComboBoxFor.getItemAt(inx)).equalsIgnoreCase( name)==
>> false){
>> inx--;
>> }
>> this.jComboBoxFor.setSelectedIndex(inx);
>> }
>> public void setCallerList(ArrayList p_saList) {
>> for(int i=0;i<p_saList.size();i++){
>> this.jComboBoxFor.addItem(p_saList.get(i));
>> }
>> }
>> public PhoneCall getPhoneCall(){
>> //public PhoneCall(String p_sCaller, String p_sPhone, String
>> p_sPhone2, String p_sQedBy, String p_sFor, String p_sNotes, String
>> p_sPri,String p_sStatus)
>> PhoneCall pcall= new
>> PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(), "",(String)jComboBoxFor.getSelectedItem(),
>> jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
>>
>> return (pcall);
>> }
>> public PhoneCall getPhoneCall(String UserID){
>> PhoneCall pcall= new
>> PhoneCall(nameJTextField.getText(),phoneJTextField.getText() ,phone2JTextField.getText(),UserID,(String)jComboBoxFor.getS electedItem(),
>> jTextFieldNotes.getText(),(String)priComboBox.getSelectedIte m(),(String)statusjComboBox.getSelectedItem(),m_oErrLog,m_oD B);
>>
>> return (pcall);
>> }
>> private Object makeObj(final String item) {
>> return new Object() { public String toString() { return item;
>> } };
>> }
>> public void setCustInfo(String name, String phone, String
>> phone2, String accountno){
>> nameJTextField.setText(name);
>> phoneJTextField.setText(phone);
>> m_phone=phone;
>> phone2JTextField.setText(phone2);
>> m_phone2=phone2;
>> this.m_sAccountNO=accountno;
>> if(this.m_oPhoneCall.isFirstCall(m_oDB,name)){
>> System.err.println("FirstCall");
>> this.jTextFieldNotes.setText("First Call:");
>> this.m_bfcall=true;
>> } else System.err.println("not F call");
>> }
>> public void setCallList(javax.swing.JList p_list){
>> m_oCallList=p_list;
>> }
>> // Variables declaration - do not modify//GEN-BEGIN:variables
>> private javax.swing.JLabel jLabel4;
>> private javax.swing.JTextField phone2JTextField;
>> private javax.swing.JLabel jLabel1;
>> private javax.swing.JLabel jLabel3;
>> private javax.swing.JTextField phoneJTextField;
>> private javax.swing.JLabel jLabel2;
>> private javax.swing.JLabel prijLabel;
>> private javax.swing.JComboBox statusjComboBox;
>> private javax.swing.JButton cancle;
>> private javax.swing.JTextField jTextFieldNotes;
>> private javax.swing.JButton jButtonOk;
>> private javax.swing.JTextField nameJTextField;
>> private javax.swing.JButton jButtionJSwitch;
>> private javax.swing.JComboBox priComboBox;
>> private javax.swing.JComboBox jComboBoxFor;
>> private javax.swing.JLabel forjLabel;
>> private javax.swing.JLabel jLabel5;
>> // End of variables declaration//GEN-END:variables
>> }
>
>
>
>
>
> ------------------------------------------------------------ ------------
>
> /*
> * AddCallDLG.java
> *
> * Created on July 16, 2001, 1:57 PM
> */
>
>
> /**
> *
> * @author david
> * @version
> */
> /* Todo
> * Make it so you pass a Phone call to the dialog and it fills it in fo you.
> *
> **/
> import javax.swing.JComboBox;
> import java.util.ArrayList;
>
> public class AddCallDLG extends javax.swing.JDialog {
> private ErrorLogging m_oErrLog;
> private int i_switch=0;
> String m_sAccountNO;
> private String m_phone, m_phone2;
> boolean m_bOkay=false;
> private boolean m_bfcall=false;
> javax.swing.JList m_oCallList;
> private PhoneCall m_oPhoneCall;
> private MyDataBase m_oDB;
> /** Creates new form AddCallDLG */
>
> public AddCallDLG(PhoneMainFrame parent,boolean modal,PhoneCall p_phone,ErrorLogging errorlog) {
> super(parent, modal);
> //PhoneMainFrame mf = (PhoneMainFrame) parent;
> m_oDB=parent.o_SqlConnection;
> m_oErrLog=errorlog;
> m_oPhoneCall=p_phone;
> initComponents();
> pack();
> }
>
> public int getStatusData(String name){
> int retval=0;
> try{
> java.sql.Statement stmt = m_oDB.m_sqlConnection.createStatement();
> java.sql.ResultSet rs = stmt.executeQuery("Select * FROM phonegroups WHERE pgroup = '"+name+"'");
> PhoneUser t_phoneuser=null;
> //create an ArrayList of PhoneCalls
> if (rs.next()){
> retval=1;
> }
> else {
> rs = stmt.executeQuery("Select * FROM phoneusers WHERE username= '"+name+"'");
> //create an ArrayList of PhoneCalls
> if (rs.next()){
> t_phoneuser = new PhoneUser(m_oDB,rs);
> retval=t_phoneuser.getUserStatus();
> }
>
> }
> } catch (Exception ex){
> // TODO Add more errorchecking code here.
> System.err.println(ex.toString());
>
> }
> return retval;
> }
> /** 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 FormEditor.
> */
> private void initComponents() {//GEN-BEGIN:initComponents
> // java.awt.GridBagConstraints gridBagConstraints; VE requires distinct constraints
>
> jLabel1 = new javax.swing.JLabel();
> jLabel2 = new javax.swing.JLabel();
> jLabel3 = new javax.swing.JLabel();
> jLabel4 = new javax.swing.JLabel();
> jLabel5 = new javax.swing.JLabel();
> nameJTextField = new javax.swing.JTextField();
> phoneJTextField = new javax.swing.JTextField();
> phone2JTextField = new javax.swing.JTextField();
> statusjComboBox = new javax.swing.JComboBox();
> jTextFieldNotes = new javax.swing.JTextField();
> jButtonOk = new javax.swing.JButton();
> cancle = new javax.swing.JButton();
> prijLabel = new javax.swing.JLabel();
> priComboBox = new javax.swing.JComboBox();
> forjLabel = new javax.swing.JLabel();
> jComboBoxFor = new javax.swing.JComboBox();
> jButtionJSwitch = new javax.swing.JButton();
>
> jDialogContentPane = new javax.swing.JPanel() ; // Explicit content pane
> setContentPane(jDialogContentPane);
> jDialogContentPane.setLayout(new java.awt.GridBagLayout());
>
> setTitle("Add a Call");
> addComponentListener(new java.awt.event.ComponentAdapter() {
> public void componentShown(java.awt.event.ComponentEvent evt) {
> formComponentShown(evt);
> }
> });
>
> addWindowListener(new java.awt.event.WindowAdapter() {
> public void windowClosing(java.awt.event.WindowEvent evt) {
> closeDialog(evt);
> }
> });
>
> jLabel1.setDisplayedMnemonic('N');
> jLabel1.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel1.setLabelFor(nameJTextField);
> jLabel1.setText("Name");
> java.awt.GridBagConstraints l1gridBagConstraints = new java.awt.GridBagConstraints();
> l1gridBagConstraints.gridx = 0;
> l1gridBagConstraints.gridy = 0;
> l1gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> l1gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(jLabel1, l1gridBagConstraints);
>
> jLabel2.setDisplayedMnemonic('P');
> jLabel2.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel2.setLabelFor(phoneJTextField);
> jLabel2.setText("Phone");
> java.awt.GridBagConstraints l2gridBagConstraints = new java.awt.GridBagConstraints();
> l2gridBagConstraints.gridx = 0;
> l2gridBagConstraints.gridy = 1;
> l2gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> l2gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(jLabel2, l2gridBagConstraints);
>
> jLabel3.setDisplayedMnemonic('2');
> jLabel3.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel3.setLabelFor(phone2JTextField);
> jLabel3.setText("Phone2");
> java.awt.GridBagConstraints l3gridBagConstraints = new java.awt.GridBagConstraints();
> l3gridBagConstraints.gridx = 0;
> l3gridBagConstraints.gridy = 2;
> l3gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> l3gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(jLabel3, l3gridBagConstraints);
>
> jLabel4.setDisplayedMnemonic('a');
> jLabel4.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel4.setLabelFor(statusjComboBox);
> jLabel4.setText("Status");
> java.awt.GridBagConstraints l4gridBagConstraints = new java.awt.GridBagConstraints();
> l4gridBagConstraints.gridx = 0;
> l4gridBagConstraints.gridy = 3;
> l4gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> l4gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(jLabel4, l4gridBagConstraints);
>
> jLabel5.setDisplayedMnemonic('t');
> jLabel5.setFont(new java.awt.Font("Dialog", 0, 14));
> jLabel5.setLabelFor(jTextFieldNotes);
> jLabel5.setText("Note");
> java.awt.GridBagConstraints l5gridBagConstraints = new java.awt.GridBagConstraints();
> l5gridBagConstraints.gridx = 0;
> l5gridBagConstraints.gridy = 5;
> l5gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> l5gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(jLabel5, l5gridBagConstraints);
>
> nameJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> nameJTextFieldFocusGained(evt);
> }
> });
>
> nameJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> nameJTextFieldKeyTyped(evt);
> }
> });
>
> java.awt.GridBagConstraints ntfgridBagConstraints = new java.awt.GridBagConstraints();
> ntfgridBagConstraints.gridx = 1;
> ntfgridBagConstraints.gridy = 0;
> ntfgridBagConstraints.gridwidth = 5;
> ntfgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> ntfgridBagConstraints.ipadx = 396;
> ntfgridBagConstraints.ipady = 10;
> ntfgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> jDialogContentPane.add(nameJTextField, ntfgridBagConstraints);
>
> phoneJTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> phoneJTextFieldFocusGained(evt);
> }
> });
>
> phoneJTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> phoneJTextFieldKeyTyped(evt);
> }
> });
>
> java.awt.GridBagConstraints ptfgridBagConstraints = new java.awt.GridBagConstraints();
> ptfgridBagConstraints.gridx = 1;
> ptfgridBagConstraints.gridy = 1;
> ptfgridBagConstraints.gridwidth = 4;
> ptfgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> ptfgridBagConstraints.ipadx = 396;
> ptfgridBagConstraints.ipady = 10;
> ptfgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> jDialogContentPane.add(phoneJTextField, ptfgridBagConstraints);
>
> phone2JTextField.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> phone2JTextFieldFocusGained(evt);
> }
> });
>
> phone2JTextField.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> phone2JTextFieldKeyTyped(evt);
> }
> });
>
> java.awt.GridBagConstraints ptf2gridBagConstraints = new java.awt.GridBagConstraints();
> ptf2gridBagConstraints.gridx = 1;
> ptf2gridBagConstraints.gridy = 2;
> ptf2gridBagConstraints.gridwidth = 4;
> ptf2gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> ptf2gridBagConstraints.ipadx = 396;
> ptf2gridBagConstraints.ipady = 10;
> ptf2gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> jDialogContentPane.add(phone2JTextField, ptf2gridBagConstraints);
>
> statusjComboBox.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> statusjComboBoxActionPerformed(evt);
> }
> });
>
> statusjComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> statusjComboBoxMouseWheelMoved(evt);
> }
> });
>
> java.awt.GridBagConstraints statgridBagConstraints = new java.awt.GridBagConstraints();
> statgridBagConstraints.gridx = 1;
> statgridBagConstraints.gridy = 3;
> statgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> statgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> jDialogContentPane.add(statusjComboBox, statgridBagConstraints);
>
> jTextFieldNotes.addFocusListener(new java.awt.event.FocusAdapter() {
> public void focusGained(java.awt.event.FocusEvent evt) {
> jTextFieldNotesFocusGained(evt);
> }
> });
>
> jTextFieldNotes.addKeyListener(new java.awt.event.KeyAdapter() {
> public void keyTyped(java.awt.event.KeyEvent evt) {
> jTextFieldNotesKeyTyped(evt);
> }
> });
>
> java.awt.GridBagConstraints ngridBagConstraints = new java.awt.GridBagConstraints();
> ngridBagConstraints.gridx = 1;
> ngridBagConstraints.gridy = 5;
> ngridBagConstraints.gridwidth = 5;
> ngridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> ngridBagConstraints.ipadx = 500;
> ngridBagConstraints.ipady = 10;
> ngridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> jDialogContentPane.add(jTextFieldNotes, ngridBagConstraints);
>
> jButtonOk.setMnemonic('O');
> jButtonOk.setText("Ok");
> jButtonOk.setSelected(true);
> jButtonOk.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> jButtonOkActionPerformed(evt);
> }
> });
>
> java.awt.GridBagConstraints okgridBagConstraints = new java.awt.GridBagConstraints();
> okgridBagConstraints.gridx = 1;
> okgridBagConstraints.gridy = 6;
> okgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> okgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
> jDialogContentPane.add(jButtonOk, okgridBagConstraints);
>
> cancle.setMnemonic('C');
> cancle.setText("Cancel");
> cancle.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> cancleActionPerformed(evt);
> }
> });
>
> java.awt.GridBagConstraints cancelgridBagConstraints = new java.awt.GridBagConstraints();
> cancelgridBagConstraints.gridx = 5;
> cancelgridBagConstraints.gridy = 6;
> cancelgridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
> cancelgridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
> cancelgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> jDialogContentPane.add(cancle, cancelgridBagConstraints);
>
> prijLabel.setDisplayedMnemonic('r');
> prijLabel.setFont(new java.awt.Font("Dialog", 0, 14));
> prijLabel.setLabelFor(priComboBox);
> prijLabel.setText("Priority ");
> prijLabel.setName("Add Call");
> java.awt.GridBagConstraints prigridBagConstraints = new java.awt.GridBagConstraints();
> prigridBagConstraints.gridx = 2;
> prigridBagConstraints.gridy = 3;
> prigridBagConstraints.gridwidth = 2;
> prigridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> jDialogContentPane.add(prijLabel, prigridBagConstraints);
>
> priComboBox.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> priComboBoxMouseWheelMoved(evt);
> }
> });
>
> java.awt.GridBagConstraints pricbgridBagConstraints = new java.awt.GridBagConstraints();
> pricbgridBagConstraints.gridx = 4;
> pricbgridBagConstraints.gridy = 3;
> pricbgridBagConstraints.gridwidth = 2;
> pricbgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> pricbgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> jDialogContentPane.add(priComboBox, pricbgridBagConstraints);
>
> forjLabel.setDisplayedMnemonic('F');
> forjLabel.setFont(new java.awt.Font("Dialog", 0, 14));
> forjLabel.setLabelFor(jComboBoxFor);
> forjLabel.setText("For");
> java.awt.GridBagConstraints lgridBagConstraints = new java.awt.GridBagConstraints();
> lgridBagConstraints.gridx = 0;
> lgridBagConstraints.gridy = 4;
> lgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> lgridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
> jDialogContentPane.add(forjLabel, lgridBagConstraints);
>
> jComboBoxFor.addMouseListener(new java.awt.event.MouseAdapter() {
> public void mouseReleased(java.awt.event.MouseEvent evt) {
> jComboBoxForMouseReleased(evt);
> }
> });
>
> jComboBoxFor.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
> public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
> jComboBoxForMouseWheelMoved(evt);
> }
> });
>
> jComboBoxFor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
> public void propertyChange(java.beans.PropertyChangeEvent evt) {
> jComboBoxForPropertyChange(evt);
> }
> });
>
> java.awt.GridBagConstraints forgridBagConstraints = new java.awt.GridBagConstraints();
> forgridBagConstraints.gridx = 1;
> forgridBagConstraints.gridy = 4;
> forgridBagConstraints.gridwidth = 5;
> forgridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
> forgridBagConstraints.ipadx = 260;
> forgridBagConstraints.ipady = 5;
> forgridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 3);
> jDialogContentPane.add(jComboBoxFor, forgridBagConstraints);
>
> jButtionJSwitch.setMnemonic('S');
> jButtionJSwitch.setText("Switch");
> jButtionJSwitch.addActionListener(new java.awt.event.ActionListener() {
> public void actionPerformed(java.awt.event.ActionEvent evt) {
> jButtionJSwitchActionPerformed(evt);
> }
> });
>
> java.awt.GridBagConstraints sgridBagConstraints = new java.awt.GridBagConstraints();
> sgridBagConstraints.gridx = 5;
> sgridBagConstraints.gridy = 1;
> sgridBagConstraints.gridheight = 2;
> sgridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
> sgridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 3);
> jDialogContentPane.add(jButtionJSwitch, sgridBagConstraints);
>
> }//GEN-END:initComponents
>
> private void jTextFieldNotesFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextFieldNotesFocusGained
> // Add your handling code here:
> if(this.m_bfcall){
> this.jTextFieldNotes.setCaretPosition(this.jTextFieldNotes.g etText().length());
> } else this.setSelectTextAll(this.jTextFieldNotes);
> }//GEN-LAST:event_jTextFieldNotesFocusGained
>
> private void phone2JTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phone2JTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.phone2JTextField);
> }//GEN-LAST:event_phone2JTextFieldFocusGained
>
> private void nameJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_nameJTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.nameJTextField);
> }//GEN-LAST:event_nameJTextFieldFocusGained
>
> private void phoneJTextFieldFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_phoneJTextFieldFocusGained
> // Add your handling code here:
> this.setSelectTextAll(this.phoneJTextField);
> }//GEN-LAST:event_phoneJTextFieldFocusGained
> private static void setSelectTextAll(javax.swing.JTextField textField){
> textField.setSelectionStart(0);
> textField.setSelectionEnd(textField.getText().length());
> }
> private void jComboBoxForMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_jComboBoxForMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.jComboBoxFor);
> }//GEN-LAST:event_jComboBoxForMouseWheelMoved
>
> private void statusjComboBoxMouseWheelMoved(java.awt.event.MouseWheelEven t evt) {//GEN-FIRST:event_statusjComboBoxMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.statusjComboBox);
> }//GEN-LAST:event_statusjComboBoxMouseWheelMoved
>
> private void scrollWheelComboBox(java.awt.event.MouseWheelEvent evt, javax.swing.JComboBox cBox){
> int i_inc = +1;
> if(evt.getWheelRotation()<0) {i_inc=-1;}
> int pos=cBox.getSelectedIndex()+i_inc;
> if(pos>=cBox.getItemCount()) pos=0;
> if(pos<0) pos=cBox.getItemCount()-1;
> cBox.setSelectedIndex(pos);
> }
> private void priComboBoxMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_priComboBoxMouseWheelMoved
> // Add your handling code here:
> this.scrollWheelComboBox(evt, this.priComboBox);
> }//GEN-LAST:event_priComboBoxMouseWheelMoved
>
> private void jComboBoxForMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jComboBoxForMouseReleased
> // Add your handling code here:
> String user =(String)this.jComboBoxFor.getSelectedItem();
> if (user!=null) if (getStatusData(user)==0){
> System.err.println("not On Phone");
> }
> }//GEN-LAST:event_jComboBoxForMouseReleased
>
> private void jComboBoxForPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jComboBoxForPropertyChange
> // Add your handling code here:
> String user =(String)this.jComboBoxFor.getSelectedItem();
> if (user!=null) if (getStatusData(user)==0){
> new NotHereDLG(new javax.swing.JFrame(), true,user).show();
> }
> }//GEN-LAST:event_jComboBoxForPropertyChange
>
> private void formComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentShown
> // Add your handling code here:
> checkTextFieldLen(jTextFieldNotes,3998);
> checkTextFieldLen(phone2JTextField,39);
> checkTextFieldLen(phoneJTextField,39);
> checkTextFieldLen(nameJTextField,79);
> if(this.m_bfcall){
> this.priComboBox.setSelectedIndex(1);
> javax.swing.JOptionPane.showMessageDialog(this,"First Call");
> }
> }//GEN-LAST:event_formComponentShown
>
> private void jTextFieldNotesKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldNotesKeyTyped
> // Add your handling code here:
> checkTextFieldLen(jTextFieldNotes,3998);
> }//GEN-LAST:event_jTextFieldNotesKeyTyped
>
> private void phone2JTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phone2JTextFieldKeyTyped
> // Add your handling code here:
> checkTextFieldLen(phone2JTextField,39);
> }//GEN-LAST:event_phone2JTextFieldKeyTyped
>
> private void phoneJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_phoneJTextFieldKeyTyped
> checkTextFieldLen(phoneJTextField,39);
> // Add your handling code here:
> }//GEN-LAST:event_phoneJTextFieldKeyTyped
>
> private void nameJTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nameJTextFieldKeyTyped
> // Add your handling code here:
> checkTextFieldLen(nameJTextField,79);
> }//GEN-LAST:event_nameJTextFieldKeyTyped
>
> private void jButtionJSwitchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtionJSwitchActionPerformed
> // Add your handling code here:
> switch(i_switch){
> case 0:
> i_switch++;
> phoneJTextField.setText(m_phone2);
> phone2JTextField.setText(m_phone);
> break;
> case 1:
> i_switch++;
> phoneJTextField.setText("");
> phone2JTextField.setText(m_phone);
> phoneJTextField.requestFocus();
> break;
> default :
> i_switch=0;
> phoneJTextField.setText(m_phone);
> phone2JTextField.setText(m_phone2);
> }
> }//GEN-LAST:event_jButtionJSwitchActionPerformed
> private void checkTextFieldLen(javax.swing.JTextField f, int size){
> String text= f.getText();
> if(text.length()>size){
> text=text.substring(0,size);
> f.setText(text);
> }
> }
> private void cancleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancleActionPerformed
> // Add your handling code here:
> setVisible(false);
> dispose();
> }//GEN-LAST:event_cancleActionPerformed
>
> private void jButtonOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOkActionPerformed
> // Add your handling code here:
> this.m_bOkay=true;
> m_
Re: VE importing NetBeans [message #573142 is a reply to message #8977] Tue, 09 December 2003 14:03 Go to previous message
Gili Mendel is currently offline Gili MendelFriend
Messages: 338
Registered: July 2009
Senior Member
David Siebert wrote:
Thanks
> Netbeans does generate a .form file that is in XML that defines the Form.
> I do not know if importing from NetBeans is even on the VE new feature
> list. But I had have a lot of .forms that I would be glad ot share with
> you all if it is wanted or needed.
>

Thanks. I would be interested to see a .forms file structure.
In any case, the goal of VE is to be able to deal with common code
patterns off hand, so that it becomes a *visual code assist* on steroids
for GUI building ;-) regardless of how the code was originated. The
NetBean pattern is quite common; and mostly recognized today by VE.
Re: VE importing NetBeans [message #573179 is a reply to message #9163] Tue, 09 December 2003 15:11 Go to previous message
Eclipse UserFriend
Originally posted by: david.eclipsecat.com

This is a multi-part message in MIME format.
--------------070402050305020508040502
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Here is the .form file for that file I posted earlyer. It looks like a
pretty easy to parse XML File to me.
BTW this is part of our telephone call system that I wrote. It replaced
a system that was written in Delphi that used XBase as the backend. I
wrote the Java based system after only playing with Java a few weeks. It
has been up for 3 years without a single crash. I for one am pretty fond
of Java on the desktop.



--------------070402050305020508040502
Content-Type: text/xml;
name="AddCallDLG.form"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="AddCallDLG.form"

<?xml version="1.0" encoding="UTF-8" ?>

<Form version="1.0" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
<Properties>
<Property name="title" type="java.lang.String" value="Add a Call"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="2"/>
</SyntheticProperties>
<Events>
<EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="formComponentShown"/>
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="closeDialog"/>
</Events>
<AuxValues>
<AuxValue name="designerSize" type="java.awt.Dimension" value=" -84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,1 05,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20, 2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116, 104,120,112,0,0,1,44,0,0,2,68 "/>
</AuxValues>

<Layout class=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t "/>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="displayedMnemonic" type="int" value="78"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="nameJTextField"/>
</Property>
<Property name="text" type="java.lang.String" value="Name"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
<Property name="displayedMnemonic" type="int" value="80"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="phoneJTextField"/>
</Property>
<Property name="text" type="java.lang.String" value="Phone"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel3">
<Properties>
<Property name="displayedMnemonic" type="int" value="50"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="phone2JTextField"/>
</Property>
<Property name="text" type="java.lang.String" value="Phone2"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel4">
<Properties>
<Property name="displayedMnemonic" type="int" value="97"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="statusjComboBox"/>
</Property>
<Property name="text" type="java.lang.String" value="Status"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="jLabel5">
<Properties>
<Property name="displayedMnemonic" type="int" value="116"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="jTextFieldNotes"/>
</Property>
<Property name="text" type="java.lang.String" value="Note"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="nameJTextField">
<Events>
<EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="nameJTextFieldFocusGained"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="nameJTextFieldKeyTyped"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="0" gridWidth="5" gridHeight="1" fill="1" ipadX="396" ipadY="10" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="phoneJTextField">
<Events>
<EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="phoneJTextFieldFocusGained"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="phoneJTextFieldKeyTyped"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="1" gridWidth="4" gridHeight="1" fill="1" ipadX="396" ipadY="10" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="phone2JTextField">
<Events>
<EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="phone2JTextFieldFocusGained"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="phone2JTextFieldKeyTyped"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="2" gridWidth="4" gridHeight="1" fill="1" ipadX="396" ipadY="10" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JComboBox" name="statusjComboBox">
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="statusjComboBoxActionPerformed"/>
<EventHandler event="mouseWheelMoved" listener="java.awt.event.MouseWheelListener" parameters="java.awt.event.MouseWheelEvent" handler="statusjComboBoxMouseWheelMoved"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_CreateCodePost" type="java.lang.String" value=""/>
</AuxValues>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="jTextFieldNotes">
<Events>
<EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="jTextFieldNotesFocusGained"/>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="jTextFieldNotesKeyTyped"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="5" gridWidth="5" gridHeight="1" fill="1" ipadX="500" ipadY="10" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="jButtonOk">
<Properties>
<Property name="mnemonic" type="int" value="79"/>
<Property name="text" type="java.lang.String" value="Ok"/>
<Property name="selected" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtonOkActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="6" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="cancle">
<Properties>
<Property name="mnemonic" type="int" value="67"/>
<Property name="text" type="java.lang.String" value="Cancel"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancleActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="5" gridY="6" gridWidth="1" gridHeight="1" fill="3" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="3" anchor="13" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="prijLabel">
<Properties>
<Property name="displayedMnemonic" type="int" value="114"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="priComboBox"/>
</Property>
<Property name="text" type="java.lang.String" value="Priority "/>
<Property name="name" type="java.lang.String" value="Add Call"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="2" gridY="3" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JComboBox" name="priComboBox">
<Events>
<EventHandler event="mouseWheelMoved" listener="java.awt.event.MouseWheelListener" parameters="java.awt.event.MouseWheelEvent" handler="priComboBoxMouseWheelMoved"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="4" gridY="3" gridWidth="2" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JLabel" name="forjLabel">
<Properties>
<Property name="displayedMnemonic" type="int" value="70"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
</Property>
<Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="jComboBoxFor"/>
</Property>
<Property name="text" type="java.lang.String" value="For"/>
</Properties>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JComboBox" name="jComboBoxFor">
<Events>
<EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jComboBoxForMouseReleased"/>
<EventHandler event="mouseWheelMoved" listener="java.awt.event.MouseWheelListener" parameters="java.awt.event.MouseWheelEvent" handler="jComboBoxForMouseWheelMoved"/>
<EventHandler event="propertyChange" listener="java.beans.PropertyChangeListener" parameters="java.beans.PropertyChangeEvent" handler="jComboBoxForPropertyChange"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="1" gridY="4" gridWidth="5" gridHeight="1" fill="1" ipadX="260" ipadY="5" insetsTop="0" insetsLeft="10" insetsBottom="0" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
<Component class="javax.swing.JButton" name="jButtionJSwitch">
<Properties>
<Property name="mnemonic" type="int" value="83"/>
<Property name="text" type="java.lang.String" value="Switch"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButtionJSwitchActionPerformed"/>
</Events>
<Constraints>
<Constraint layoutClass=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t " value=" org.netbeans.modules.form.compat2.layouts.DesignGridBagLayou t$GridBagConstraintsDescription ">
<GridBagConstraints gridX="5" gridY="1" gridWidth="1" gridHeight="2" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="3" anchor="10" weightX="0.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
</SubComponents>
</Form>

--------------070402050305020508040502--
Re: VE importing NetBeans [message #611296 is a reply to message #8208] Fri, 04 November 2005 20:58 Go to previous message
Dennis Piccioni is currently offline Dennis PiccioniFriend
Messages: 3
Registered: July 2009
Junior Member
On Thu, 04 Dec 2003 10:28:55 -0500, David Siebert
<david@eclipsecat.com> wrote:

>I did try it and it looks a little odd. Actually I tried it before I posted.
>What is odd is that it looks like all of the elements are there but they
>are not put together. I do not know it that is the way that VE supposed
>to look or not. I just got Eclipse working and I am considering using it
>instead of NetBeans. Net Beans has been very good to me but it is a
>little slow.
>
>Peter Walker wrote:
>> This is not officially supported and I haven't tried this yet... not sure
>> what the code looks like that comes out of Netbeans. If the code patterns
>> are such that each AWT/Swing component is declared in the class and has a
>> method that initializes it (i.e. jButton = new JButton()), it should work.
>> Please feel free to try it and report your results.
>>
>> Thanks...
>> Peter walker
>>

Hi all,

I just had the same experience. I'm pretty surprised this has not
changed in almost 2 years...

Regards,
Dennis
Re: VE importing NetBeans [message #611297 is a reply to message #110571] Fri, 04 November 2005 22:14 Go to previous message
Dennis Piccioni is currently offline Dennis PiccioniFriend
Messages: 3
Registered: July 2009
Junior Member
>Hi all,
>
>I just had the same experience. I'm pretty surprised this has not
>changed in almost 2 years...
>
>Regards,
>Dennis

I have now read the other threads about doing this, and I have to say
it's pretty lame that Eclipse doesn't just handle this more
appropriately, such as asking the user if he/she wants to convert the
code, or just doing so. Importing existing NetBeans visual code like
this turns out to be either a tedious project to get it right, or
winds up having weird looking stuff that's hard to work with if you
want to make changes in the VE later.

Regards,
Dennis
Previous Topic:extend VE - palette and editor
Next Topic:MoreSwingComponents fails 3.2M2
Goto Forum:
  


Current Time: Fri Apr 26 20:04:16 GMT 2024

Powered by FUDForum. Page generated in 0.07787 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top