comp.lang.java.programmer
http://groups-beta.google.com/group/comp.lang.java.programmer
[EMAIL PROTECTED]

Today's topics:

* Beginning EJB - 3 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d49babfdb472b21c
* ServletExec hangman.jsp example problem - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/54268d21ea6231b2
* can't connect to remote host - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9034767efdc4ba0e
* NetBeans 4.0 totally blows. What other IDE's are available? - 3 messages, 3 
authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cd46bbd76ba757ee
* Unable to establish a socket connection - 2 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3db1070c05ec0b49
* jsp servlet code seperation confusion - 2 messages, 2 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e71d75f30f442d21
* Using hobby source code in your job ? - 3 messages, 3 authors
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a60dfe865a7807c4
* New String - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/480ebe0f50a46c11
* custom events - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a956d4ae3139c777
* Abstract IMAP server? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a083196a546794b
* JDO Question : Is it possible to get unique values like DISTINCT in SQL? - 1 
messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e48b52e65e122b13
* Invalid cursor state - Am I completely stupid? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/780f6a3d7ad2d49a
* Web Search Engine - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9d8197f0a3a6d7b9
* Application in sandbox - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/821eb31df84b5c4a
* Thoughtsworks Job Interview? - 1 messages, 1 author
 
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/65e47be2d93e5821

==============================================================================
TOPIC: Beginning EJB
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d49babfdb472b21c
==============================================================================

== 1 of 3 ==
Date: Fri, Dec 3 2004 2:38 pm
From: "Darryl L. Pierce"  

Ann wrote:

>>>I heard a rumor that EJB is now "old hat." Can anyone confirm?
>>
>>I heard that FUD in Java newsgroups is now "old hat". Can anyone confirm?
> 
> Good one, made me smile ;-)

Right back atcha, missus.

-- 
Darryl L. Pierce <[EMAIL PROTECTED]>
Visit my webpage: <http://mcpierce.multiply.com>
"By doubting we come to inquiry, through inquiry truth."
     - Peter Abelard



== 2 of 3 ==
Date: Fri, Dec 3 2004 2:39 pm
From: "Darryl L. Pierce"  

Collin VanDyck wrote:

>> I heard a rumor that EJB is now "old hat." Can anyone confirm?
>>
> EJB 2.x is certainly awful in a lot of ways.  As has been mentioned, 3.0 
> should take away a lot of the pain, and I'm really looking forward to it!

What, specifically, would you consider to be painful about 2.x? 
Especially with 2.1, I find it to be a breath of very useful fresh air. 
1.x was painful, sure, but 2.x has been quite useful and IMO powerful a 
tool to use.

-- 
Darryl L. Pierce <[EMAIL PROTECTED]>
Visit my webpage: <http://mcpierce.multiply.com>
"By doubting we come to inquiry, through inquiry truth."
     - Peter Abelard



== 3 of 3 ==
Date: Fri, Dec 3 2004 2:48 pm
From: Don Conrad  

Darryl L. Pierce wrote:
> Nagu wrote:
> 
>> I have interests to pursue career in components development (EJB ).
>> Where do I start. I have good knowledge about JAVA language but not on
>> any other J2EE or J2Se technologies? What are the prerequisites to
>> learn EJB?
> 
> 
> Start off by using a good text reference. I recommend _Enterprise Java 
> Beans_ from O'Reilly, along with a copy of Eclipse, JBoss and JBoss-IDE. 
> Those together make for an excellent learning environment.
> 


What about using MyEclipse to get the J2EE support?




==============================================================================
TOPIC: ServletExec hangman.jsp example problem
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/54268d21ea6231b2
==============================================================================

== 1 of 1 ==
Date: Fri, Dec 3 2004 2:54 pm
From: "Ann"  


"Matthew" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm trying to get servlet exec isapi running. Off a very clean install
> I follow the simple instructions for the hangman.jsp example. I move
> the hangman.jsp file to the www root folder. then i add the bean's
> classpth to the servletexecs classpath variable. (i'm sure i did that
> step right). but then by going to http://localhost/hangman.jsp i get a
> page error. Anyone out the who's been through this and got any ideas.
>
> this is very frustrating.....
>
> thx
> matthew

what is error number, is it 550, is it 404 ?






==============================================================================
TOPIC: can't connect to remote host
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9034767efdc4ba0e
==============================================================================

== 1 of 1 ==
Date: Fri, Dec 3 2004 3:01 pm
From: "Sid"  

hello!

I have a client/server program in which client lets user input two
numbers and the server adds the numbers and returns the sum to client.

the problems I am having are:

1. client is not able to connect to remote server. it is only
connecting to local host.

2. if a string seperated by "non-numeric" characters (e.g. 34a2dd) is
sent, both client and server throw an uncaught exception. i need to
fix the client or server or both and give useful feedback to the user.
i need to do the error checking of user i/p so that user enters only
integers seperated by whitespace.

I am attaching my code.
I am new to java and probably don't know much.
'shall greatly appreciate your help.

thanks in advance,
siddharth

code:

// usage: java TCPAdditionServer3 <port number>
// default port is 7777
// connection to be closed by client
// this server handles only one connection

import java.io.*;
import java.net.*;
import java.lang.*;
import java.util.*;

class TCPAdditionServer3{
public static void main(String[] args)throws Exception{
String clientSentence,capitalizedSentence;
int sum=0;
String sumString = "";
InetAddress serverAddress;
int portNumber = 7777;
Socket connectionSocket = null;

try {
portNumber = Integer.parseInt(args[0]);
}
catch (Exception e) {
System.out.println(" port = 7777 (default)");
portNumber = 7777;
}

// create welcoming socket at port number specified by user or
7777 if no choice is specified by user
ServerSocket welcomeSocket=new ServerSocket(portNumber);

//server infinite loop
while(true){
try {
// wait, on welcoming socket for contact by
client
connectionSocket=welcomeSocket.accept();
} catch (IOException e) {
System.out.println("Accept failed:");
System.exit(-1);
}

// create input stream, attached to socket
BufferedReader inFromClient=new BufferedReader(new
InputStreamReader(connectionSocket.getInputStream()));
// create output stream, attached to socket
DataOutputStream outToClient=new
DataOutputStream(connectionSocket.getOutputStream());

// read in line from socket
clientSentence=inFromClient.readLine();

StringTokenizer st= new StringTokenizer(clientSentence);
while(st.hasMoreTokens()) {
sum += Integer.parseInt(st.nextToken());
}

System.out.println("Waiting for connections on port " +
connectionSocket.getLocalPort() + " ... ");
System.out.println("Received connection from " +
connectionSocket.getInetAddress() + ":" +
connectionSocket.getLocalPort());

sumString = Integer.toString(sum);
clientSentence = " ";
capitalizedSentence = clientSentence  + sumString + "\n";

//write out line to socket
outToClient.writeBytes(capitalizedSentence);

//connection closed by client
try {
connectionSocket.close();
System.out.println("Connection closed by client");
}
catch (IOException e) {
System.out.println(e);
}

}
}

}

code:

// usage: java TCPAdditionClient3 <server> <port>
// default port is 7777

/**
* TCPAdditionClient1.java
*
*  @author Siddharth Jain
* @version 3.0
*/

/** Client Code */

import java.io.*;
import java.net.*;

/** this is the main class */
class TCPAdditionClient3{
public static void main(String[] args)throws Exception{

String sentence,sentc,portNumberString;
int portNumber= 7777;
String hostName = "localhost";
String modifiedSentence;
InetAddress clientAddress;
/** create input stream */
BufferedReader inFromUser1=new BufferedReader(new
InputStreamReader(System.in));

/** read arguments */
if(args.length == 2) {
hostName = args[0];
try {
portNumber = Integer.parseInt(args[1]);
System.out.println("client user i/p port number " +
portNumber);
}
catch (Exception e) {
System.out.println(" server port = 7777 (default)");
portNumber = 7777;
}
}

/** connect to server */
try{
/** create client socket, connect to server */
Socket clientSocket=new Socket(hostName,portNumber);

if (clientSocket.isConnected()== true);
{
System.out.println("Connecting to Server " +
clientSocket.getInetAddress() + ":" + clientSocket.getPort() + "..." +
"Connected");
}

/** create output stream attached to socket */
DataOutputStream outToServer=new
DataOutputStream(clientSocket.getOutputStream());
/** create input stream attached to socket */
BufferedReader inFromServer=new BufferedReader(new
InputStreamReader(clientSocket.getInputStream()));

System.out.println();
System.out.println("Enter a string of integers seperated by
non-numeric characters:");

sentence = inFromUser1.readLine();
/**send line to server */
outToServer.writeBytes(sentence+"\n");
/** read line from server */
modifiedSentence=inFromServer.readLine();
System.out.println("From Server-----> The Sum
is:"+modifiedSentence);

try {
clientSocket.close();
}
catch(IOException e) {
System.out.println(e);
}

} catch(UnknownHostException e) {
System.err.println(" Don't know about host: ");
System.exit(1);
} catch(IOException e) {
System.err.println(" Couldn't get I/O for the connection");
System.exit(1);
   }

   }
}





==============================================================================
TOPIC: NetBeans 4.0 totally blows. What other IDE's are available?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cd46bbd76ba757ee
==============================================================================

== 1 of 3 ==
Date: Fri, Dec 3 2004 3:08 pm
From: "xarax"  

Subject line says it all. NetBeans 4.0 is a
total disaster. I need something else that is
free.





== 2 of 3 ==
Date: Fri, Dec 3 2004 3:10 pm
From: Thomas Kellerer  

xarax wrote on 04.12.2004 00:08:

> Subject line says it all. NetBeans 4.0 is a
> total disaster. I need something else that is
> free.
> 
> 
Use NetBeans 3.6 :)

Thomas



== 3 of 3 ==
Date: Fri, Dec 3 2004 3:18 pm
From: Michael Borgwardt 
 

xarax wrote:

> Subject line says it all. NetBeans 4.0 is a total disaster.

Why exactly?

> I need something else that is free.

eclipse




==============================================================================
TOPIC: Unable to establish a socket connection
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3db1070c05ec0b49
==============================================================================

== 1 of 2 ==
Date: Fri, Dec 3 2004 3:13 pm
From: [EMAIL PROTECTED] (S J Rulison) 

One thing I forgot to mention in the last post.  The results were the
same when I loaded the applet from a remote (seperate) PC or when I
loaded it from the JServer PC.  Both returned a Nullpointer Exception.



== 2 of 2 ==
Date: Fri, Dec 3 2004 5:49 pm
From: [EMAIL PROTECTED] (S J Rulison) 

Question 1:
EXACTLY how are you launchng this applet??? 
Are you downloading it from a web server in a browser (as we have all 
assumed so far), or are you in fact opening a local file with your 
browser (File->Open...)?

I am opening a local file from a browser.  As I stated in an earlier
post, I am simply running a java server application on a windows XP
workstation.  It is not a web server


I didn't waste much time with the getCodeBase.getHost() thing.




==============================================================================
TOPIC: jsp servlet code seperation confusion
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e71d75f30f442d21
==============================================================================

== 1 of 2 ==
Date: Fri, Dec 3 2004 4:57 pm
From: Martman  

I posted this on the .help NG but I believe you folks could probably 
provide more of an accurate answer considering the help group is 
targeted towards true beginners.

Okay, where I am employeed I have the options of programming with 
Microsoft Technologies and Java specifically J2EE. I have been 
investigating the task of learning Java for about the last 3 to 4 
months. I am a ASP.Net developer fulltime at work with C#. I was new to 
OOP when I started into .Net about a year ago and am getting better. 
However, our corporation uses Java as a National standard and I am 
looking to advance some day and need to learn Java. Furthermore, where I 
live, KY there are very few jobs for technologies other than .Net and 
Java. No PHP or ColdFusion.

In the last couple of years this code seperation theory has overloaded 
the programming world. .Net does it with what's called code behind. In 
my research of Java the only things I see that reference code seperation 
is servlets (I am sure J2EE and EJB contribute also). However, 
everything I have read on servlets reference outputing HTML back to the 
browser via the HttpServletResponse and Request objects.

My question, why in the world do they consider outputting HTML back to a 
  browser via a servlet considered code seperation. Furthermore, it 
seems very time consuming and difficult to hand code complex layouts in 
HTML and incorporate/format it for a servlet.

Can someone please explain or direct me to a resource where I can 
understand why using servlets at any point in an application would be 
better than jsp or even applets? Sometimes it's hard enough to design 
complex layouts with the assistance Dreamweaver for example.

Thanks for any insight you can provide, I have read hundreds of pages of 
information concerning this and trying to compare it with the my current 
knowledge in the .Net world.

Marty U.



== 2 of 2 ==
Date: Fri, Dec 3 2004 7:32 pm
From: Anzime  

Martman wrote:
> I posted this on the .help NG but I believe you folks could probably 
> provide more of an accurate answer considering the help group is 
> targeted towards true beginners.
> 
> Okay, where I am employeed I have the options of programming with 
> Microsoft Technologies and Java specifically J2EE. I have been 
> investigating the task of learning Java for about the last 3 to 4 
> months. I am a ASP.Net developer fulltime at work with C#. I was new to 
> OOP when I started into .Net about a year ago and am getting better. 
> However, our corporation uses Java as a National standard and I am 
> looking to advance some day and need to learn Java. Furthermore, where I 
> live, KY there are very few jobs for technologies other than .Net and 
> Java. No PHP or ColdFusion.
> 
> In the last couple of years this code seperation theory has overloaded 
> the programming world. .Net does it with what's called code behind. In 
> my research of Java the only things I see that reference code seperation 
> is servlets (I am sure J2EE and EJB contribute also). However, 
> everything I have read on servlets reference outputing HTML back to the 
> browser via the HttpServletResponse and Request objects.
> 
> My question, why in the world do they consider outputting HTML back to a 
>  browser via a servlet considered code seperation. Furthermore, it seems 
> very time consuming and difficult to hand code complex layouts in HTML 
> and incorporate/format it for a servlet.
> 
> Can someone please explain or direct me to a resource where I can 
> understand why using servlets at any point in an application would be 
> better than jsp or even applets? Sometimes it's hard enough to design 
> complex layouts with the assistance Dreamweaver for example.
> 
> Thanks for any insight you can provide, I have read hundreds of pages of 
> information concerning this and trying to compare it with the my current 
> knowledge in the .Net world.
> 
> Marty U.

I haven't looked at .Net at all, so I everything I say is from
a Java perspective.

You wouldn't want to hard code HTML in a servlet; it's ugly, and
difficult to maintain. Servlets are great for non-visual applications
where you need HTTP support (request, response, etc).

When you mention code separation I think you are talking about
separting the "display code", "business logic", and "control logic".
There are many tutorials on the web that mention "Model2"
development; a derivation of "MVC". Also, their are many frameworks
to choose from to assist your development. Regardless, it all boils
down to discipline and proper thinking. Think in layers and OO,
e.g. how can you separate the "model" (data), from the
"view" (display), from the "control" (logic); all comprise the
term MVC.

Alone, Java Server Pages (JSP) can be misused by incorporating
Java code as scriplets; doing everything from database connections
to business logic and application flow. A better approach would be
to only put HTML in JSPs and use Java tags to display dynamic data.
Your data would go in Java classes that follow the bean convention
with private fields and public getters and setters. Your
business and application logic would go in other classes; packaged
appropriately. While you're at it, you might as well look at
decoupling further by putting logic in a set of classes, creating
handlers that call DAO classes that handle database accesses, etc.

There are many ways to slice an application. I recommend looking
into the Apache Struts framework; It's well documented and would
be a good learning experience.

On top of all that, you still have many other areas to apply the
same principles: EJBs, RMI, etc.

-- 
Regards,
Anzime





==============================================================================
TOPIC: Using hobby source code in your job ?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a60dfe865a7807c4
==============================================================================

== 1 of 3 ==
Date: Fri, Dec 3 2004 5:14 pm
From: Nils O. Selåsdal  

On Fri, 03 Dec 2004 20:47:52 +0100, Skybuck Flying wrote:

> Ok,
> 
> Suppose you have programmed a lot of "re-useable" source code.
> 
> Suppose you're considering taking a programming job in the same language as
> your hobby programming language.
> 
> The question rises:
> 
> 1. Do you use your hobby source code in your job ?
Sure.
> This could create problems ?!?
Sure
> 2. For example without thinking about it you might loose the rights to your
> hobby source code.
No/depends on the license.
The solution: Start thinking.




== 2 of 3 ==
Date: Fri, Dec 3 2004 6:07 pm
From: "E. Robert Tisdale"  

Skybuck Flying wrote:

> Suppose you have programmed a lot of "re-useable" source code.
> 
> Suppose you're considering taking a programming job
> in the same language as your hobby programming language.
> 
> The question rises:
> 
> 1. Do you use your hobby source code in your job?
> 
> This could create problems?
> 
> 2. For example, without thinking about it
> you might loose the rights to your hobby source code.
> 
> So what would you do?
> 
> I myself see a number of possiblities:
> 
> 1. Don't even take a job in the same programming language as your hobby.
> 
> 2. Don't even use your hobby source code.
> 
> 3. In case you do use it, give the company a license to use your compiled
> source, they probably won't like that.
> 
> 4. Give the company a license to use your source code.
> 
> 5. "Open Source" your code... like gnu license.
> 
> 6. Make your source code freeware.
> 
> Again I ask... which alternative would you use... 
> is there another alternative?
> 
> In short what would you do?

You *must* copyright your code.
Usually, it is sufficient to write something like

         Copyright 2004 Skybuck Flying

somewhere near the top of each source file.

Your employer cannot compel you to transfer the copyright
for code that you wrote on your own time
or code that you wrote for another employer.

You can re-write code that you have written before
for your new employer but you cannot copy any of the old code.
This is probably the best solution as it gives you a chance
to fix mistakes that you make in the old code.

My experience is that employers have no objection
to using third party packages or even freeware
if they can get the necessary licenses at a reasonable price.
Don't try to *sell* your employer a license
as this creates a "conflict of interest".
You can distribute your code under an open source license
and you should try to convince your employer
to allow you to "contribute" to the package
which would allow you to maintain your software on company time.



== 3 of 3 ==
Date: Fri, Dec 3 2004 7:04 pm
From: Thomas Matthews  

Skybuck Flying wrote:
> Ok,
> 
> Suppose you have programmed a lot of "re-useable" source code.
> 
> Suppose you're considering taking a programming job in the same language as
> your hobby programming language.
> 
> The question rises:
> 
> 1. Do you use your hobby source code in your job ?
Not unless you gain some benefit from the company.

> 
> This could create problems ?!?
Yes, especially under trade secrets, patents, copyrights and ownership.
Many employers have a standard of "whatever is created at their
facilities or using their equipment is theirs."  Some may extend
the scope to include any software written by their employees.  Read
and understand the employment contract carefully before using any
personal software for your employer.


> 2. For example without thinking about it you might loose the rights to your
> hobby source code.
That is possible. Read the employment contract.  Ask your manager
about the legalities of using personal code in their projects.

> 
> So what would you do ?
> 
> I myself see a number of possiblities:
> 
> 1. Don't even take a job in the same programming language as your hobby.
No.  You can have a hobby that uses the same programming language as
your profession.  Just make sure that there is a clean definition
and separation between your hobby and profession.


> 2. Don't even use your hobby source code.
That is safe.  However, there may be some middle ground.  Talk to
the project manager or company lawyers.


> 3. In case you do use it, give the company a license to use your compiled
> source, they probably won't like that.
They may as long as they reap some benefit from it.
Again, ask the employer.

> 
> 4. Give the company a license to use your source code.
> 
> 5. "Open Source" your code... like gnu license.
> 
> 6. Make your source code freeware.
> 
> Again I ask... which alternative would you use... is there another
> alternative ?
> 
> In short what would you do ?
I would talk to my manager, and consult a lawyer.

> 
> Bye,
>   Skybuck.
> 
> 



-- 
Thomas Matthews

C++ newsgroup welcome message:
          http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq:   http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
          http://www.comeaucomputing.com/learn/faq/
Other sites:
     http://www.josuttis.com  -- C++ STL Library book
     http://www.sgi.com/tech/stl -- Standard Template Library





==============================================================================
TOPIC: New String
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/480ebe0f50a46c11
==============================================================================

== 1 of 1 ==
Date: Fri, Dec 3 2004 5:13 pm
From: Starshine Moonbeam  

In article <[EMAIL PROTECTED]>, Michael Borgwardt 
([EMAIL PROTECTED]) dropped a +5 bundle of words...

> Starshine Moonbeam wrote:
> > Anyway, it wasn't a bagging on you as it was to point it out. Someone 
> > might be inclined to name their class String, which you can't do.
> 
> Sure you can. You just can't put it (or, in fact, anything) into the package
> java.lang.

Okay, my bad. Mini-experiment proves this true. 

-- 
Starshine Moonbeam
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM













==============================================================================
TOPIC: custom events
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a956d4ae3139c777
==============================================================================

== 1 of 1 ==
Date: Fri, Dec 3 2004 5:28 pm
From: "Oxnard"  

I am trying to use custom events. The custom events do nothing more than
write to a JTextArea. It is a log of sorts.

After much struggling I was able to get a single custom event from a class
which extends a JFrame to write to the JTextArea. I now, however want to
have more than one message from the JFrame to be written to the based upon
what occurs. I am not clear what is the best way to go about this.

It seems that maybe the best way is to "look inside" of my custom event
which I have named JFrameEvent. It seems like this is what you do when you
do a JComponent.getName().

Another thought I had was to do something with AWTEvent.RESERVED_ID_MAX but
again I'm not sure.

My question is how (and if) I can expand what I have to have the handler
class look into the JFrameEvent and figure out which JFrameEvent has
occured?

I have marked in the jFrame class where I want the next event to occur.
Here's a summary of the code I have:



public class jFrame extends JFrame{

public jFrame() {
    h = new Handler(this);
    setTitle("crap");
    setSize(new Dimension(100,100));

    setupMenu();

    jp1 = new jPanel1();
    getContentPane().add(jp1);

    this.canLoadDriver();
    chooser = new JFileChooser();
  }

  public void canLoadDriver(){
    try{
      ociCONN = new ociConn();
    }
    catch(ClassNotFoundException e){
     //  this is the first event I got to work!
      JFrameEvent jFrameEvent = new JFrameEvent(this);

Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(jFrameEvent);

// in looking at this I noted it returns JFrameEvent[] maybe I have an array
of JFrameEvents ?? not sure how to work with it.
      System.out.println(jFrameEvent.toString() + "  " +
jFrameEvent.getID());
    }
  }

  public void processEvent(AWTEvent e){
    if(e instanceof JFrameEvent){
      listener.myListenerMethod((JFrameEvent) e);
    }else{
      super.processEvent(e); // there are other events which must be handled
such as Mouse Windows etc.
                             // Can use
System.out.println(e.getClass().getName());
    }
  }

  public void addMyListener(MyListener listener){
    this.listener=listener;
  }


  /**
   named inner class
  */
  private class copyTypeAction implements ActionListener{
   public void actionPerformed(ActionEvent event){

    if (dialog == null) dialog = new copyType(); // where the dialog is
created
      if(dialog.showDialog(jFrame.this," ")){

// I want to have another event here.!!!!!!!!!!!!!!!!!

        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int result = chooser.showOpenDialog(jFrame.this);

      }
    }
 } // end of named inner class copyTypeAction

  MyListener listener = null;
  Handler h = null;
  private jPanel1 jp1;
  private ociConn ociCONN;
  private copyType dialog = null;
  private JFileChooser chooser;
}

public class Handler implements MyListener, ActionListener{

  public Handler(jFrame j){
    j.addMyListener(this);
    this.j = j;
  }

  public Handler(JTextField tf){
    String s = tf.getName();
    if (s.equals("tf1")){
      tf1 = tf;
    }
  }

  public Handler(jPanel1 jp1){
    this.jp1 = jp1;
  }

  public void myListenerMethod(JFrameEvent e) {
    //System.out.println("in handler");
    jp1.setText("here it is");

/** I really want something like:
String s = jp1.getName();
if (s.equals("the class not found")){
   jp1.setText("class not found");
else if (s.equals("the class not found")){
   jp1.setText("my JFrameEvent just before the chooser")
}
  }
*/

  public void actionPerformed(ActionEvent e) {
  }

  private static jFrame j;
  private static jPanel1 jp1;
  // private static JTextArea jta;
  private static JTextField tf1;
}

public class JFrameEvent extends AWTEvent{

  /** Creates a new instance of JFrameEvent */
  public JFrameEvent(Object source) {
    super(source, JFRAME_EVENT);
    // System.out.println("in JFrameEvent");
  }
  public static final int JFRAME_EVENT=AWTEvent.RESERVED_ID_MAX + 5555;
}


public interface MyListener extends EventListener{
  public void myListenerMethod(JFrameEvent e);
}

public class jPanel1 extends JPanel{

  public jPanel1() {
    h = new Handler(this);
    taA = new JTextArea(8, 40);
    taA.setEditable(false);
    taA.setName("taA");
    JScrollPane scrollPane = new JScrollPane(taA);
    add(scrollPane); // add the JScrollPane NOT the JTextArea as the
                     // JScrollPane incapulates the JTextArea
  }

  public void setText(String s){
    taA.append(s);
  }

  Handler h = null;
  private JTextField tf1;
  private JTextArea taA;
}




Thank you very much
Ox







==============================================================================
TOPIC: Abstract IMAP server?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a083196a546794b
==============================================================================

== 1 of 1 ==
Date: Fri, Dec 3 2004 5:46 pm
From: karl wettin  

Is there such a thing around? I could use one.


-- 

   karl




==============================================================================
TOPIC: JDO Question : Is it possible to get unique values like DISTINCT in SQL?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e48b52e65e122b13
==============================================================================

== 1 of 1 ==
Date: Fri, Dec 3 2004 5:53 pm
From: [EMAIL PROTECTED] (Klixx0r) 

Hi all,

I use DISTINCT in my SQL queries to get unique values where there 
are duplicates in my DB tables. As JDO is a layer on top on JDBC 
and it has its own query syntax (I don't think it allows SQL) ... I 
was wondering if something like the effect of DISTINCT is possible?

Like if I had a field in my persitance enabled class called 
customerName, and it 5 instances had values of 
"A","B","B","C","D" ... i would want it to get all of them but only 
one of the "B". Is this possible with JDO?

Thanks

----------------------------------------------
Posted with NewsLeecher v1.0 Final
 * Binary Usenet Leeching Made Easy
 * http://www.newsleecher.com/?usenet
----------------------------------------------





==============================================================================
TOPIC: Invalid cursor state - Am I completely stupid?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/780f6a3d7ad2d49a
==============================================================================

== 1 of 1 ==
Date: Fri, Dec 3 2004 5:58 pm
From: [EMAIL PROTECTED] (Klixx0r) 

Hi m8, I think ur problem is with ur stmt object, uve created it 
with parameters, as default its read only and foward only cursor 
mode... try it with other pars like scrollable ... I think this 
will solve it, I had similar problem before.

L8er

----------------------------------------------
Posted with NewsLeecher v1.0 Final
 * Binary Usenet Leeching Made Easy
 * http://www.newsleecher.com/?usenet
----------------------------------------------





==============================================================================
TOPIC: Web Search Engine
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9d8197f0a3a6d7b9
==============================================================================

== 1 of 1 ==
Date: Fri, Dec 3 2004 6:53 pm
From: Anzime  

Heiner Kücker wrote:
> Harindu00 wrote
> 
>>I am developing a web search engine. Which technology should i use
>>JSP Or Servlets If any body has a tip please tell me
> 
> 
> You will need an client technologie like apache http client for scanning web 
> sites.
> 
> For user client is JSP an good choice.
> 

What are you trying to accomplish with JSP or Servlets?

-- 
Regards,
Anzime





==============================================================================
TOPIC: Application in sandbox
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/821eb31df84b5c4a
==============================================================================

== 1 of 1 ==
Date: Fri, Dec 3 2004 7:40 pm
From: "Intel Inside"  


Oh I am surprised, I didn't know .Not and C# were open source projects, Oh 
that's right, they're not...

> Nobody in their right mind wants to build their house on land
> owned by someone else.

Thanks for the tip Tim, I'd better stop development using the .Not platform 
asap. 






==============================================================================
TOPIC: Thoughtsworks Job Interview?
http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/65e47be2d93e5821
==============================================================================

== 1 of 1 ==
Date: Fri, Dec 3 2004 7:37 pm
From: Anzime  

Nus wrote:
> How was the interview with Thoughtworks?
> 
> MarathonMan wrote:
> 
>>Hi,
>>
>>Any one interviewed with Thoughtworks for a Java position? Whats been
>>your experience? And how tough are their coding tests during
> 
> interview
> 
>>process. Im thinking about applying to Thoughtworks.
>>
>>Thanks,
>>--Anil
> 
> 

If you have to worry about "coding tests" you need to code.

-- 
Regards,
Anzime




==============================================================================

You received this message because you are subscribed to the Google
Groups "comp.lang.java.programmer" group.

To post to this group, send email to [EMAIL PROTECTED] or
visit http://groups-beta.google.com/group/comp.lang.java.programmer

To unsubscribe from this group, send email to
[EMAIL PROTECTED]

To change the way you get mail from this group, visit:
http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe

To report abuse, send email explaining the problem to [EMAIL PROTECTED]

==============================================================================
Google Groups: http://groups-beta.google.com 

Reply via email to