AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Parallel Port Access
Goto page Previous  1, 2, 3 ... 58, 59, 60 ... 62, 63, 64  Next
 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Andrew Thompson
Guest





PostPosted: Thu Apr 12, 2007 6:52 pm    Post subject: Re: Learning GUI Development in Java Reply with quote



Prince of Code wrote:
..
Quote:
...Give me suggestion of Books..

Good Java related book reviews are available here.
<http://www.techbookreport.com/JavaIndex.html>

I can also vouch that the Java Tutorial (the other
respondent linked to the Swing GUI section of it)
is a great resource for learning Java.

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200704/1
Back to top
JohnT
Guest





PostPosted: Thu Apr 12, 2007 7:03 pm    Post subject: Re: Creating Webmessenger Reply with quote



Andrew Thompson wrote:
Quote:
Prince of Code wrote:
.
...I am suspecious about is Is there some
web messenger OSS out there. So that i can tweak it to my needs.

Out of curiosity, what is your budget for this project?

He's a prince, his budget should be unlimited.
Back to top
blmblm@myrealbox.com
Guest





PostPosted: Sat Apr 14, 2007 12:09 am    Post subject: Re: How do I get the address of (&) an object... Reply with quote



In article <5B5Th.29620$mo3.291224 (AT) weber (DOT) videotron.net>,
Oliver Wong <owong (AT) castortech (DOT) com> wrote:
Quote:

blmblm (AT) myrealbox (DOT) com> wrote in message
news:5841v9F2fnndoU2 (AT) mid (DOT) individual.net...

Another thing: My news server seems not to be getting all of
the OP's posts (unless they're just being delayed). In a check
earlier of GG's archives, they have three messages from "me2"
(I may have these out of sequence):

Message-Id: <pan.2007.04.10.17.42.52.231772 (AT) somewhere (DOT) com
Message-Id: <pan.2007.04.10.18.06.18.52551 (AT) somewhere (DOT) com
Message-Id: <pan.2007.04.10.19.01.55.168201 (AT) somewhere (DOT) com

but only the middle one has shown up, as of this writing, at
News.Individual.Net as best I can tell. Anyone else notice
something similar?

I got all 3, though I only saw the 3rd this morning. I'm using
Videotron's servers.

The other two posts apparently never showed up at my news server.
Huh.

--
Decline To State
(But the e-mail address in the header is real.)
Back to top
printdude1968@gmail.com
Guest





PostPosted: Sun Apr 15, 2007 11:51 pm    Post subject: Re: Question about ant and running java programs Reply with quote

On Apr 15, 11:55 am, "Daniel Dyer" <"You don't need it"> wrote:

Quote:

You must specify a manifest when you create the JAR file. The manifest is
a file called MANIFEST.MF that goes in the META-INF directory of the JAR.
In order for the JAR file to be executable, it must contain a property
called "Main-Class" that specifies the fully-qualified name of the class
that contains the main method.

The Ant <jar> task provides a way to specify manifest entries.

You need to add something like this as content for the <jar> element:

manifest
attribute name="Main-Class" value="com.mydomain.MyMainClass"/
/manifest

Dan.

--
Daniel Dyerhttps://watchmaker.dev.java.net- Evolutionary Algorithm Framework for Java

Here is a link to the site where I got the build.xml file from

http://ant.apache.org/manual/using.html

As you can see, it makes no mention of MANIFESTS.

Why would the authors go through the trouble of creating a sample
build.xml file if they knew that an important component was missing?
Anyone trying to execute "ant dist" using that build file would run
into the same problem as me.
Back to top
Daniel Gee
Guest





PostPosted: Sun Apr 15, 2007 11:54 pm    Post subject: Re: How does one find the terminal's width within the JVM? Reply with quote

I figured there might be no such simple solution, oh well.
Back to top
Andrew Thompson
Guest





PostPosted: Mon Apr 16, 2007 4:29 am    Post subject: Re: Question about ant and running java programs Reply with quote

printdude1968 (AT) gmail (DOT) com wrote:
....
Quote:
http://ant.apache.org/manual/using.html

As you can see, it makes no mention of MANIFESTS.

Why would the authors go through the trouble of creating a sample
build.xml file if they knew that an important component was missing?

Maybe they meant you to specify the main at runtime
(as I suggested earlier), or the project is normally
launched via. webstart (no manifest required) or it
is an applet (no manifest required).

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200704/1
Back to top
JohnT
Guest





PostPosted: Mon Apr 16, 2007 7:26 pm    Post subject: Re: Question about ant and running java programs Reply with quote

Andrew Thompson wrote:
Quote:
printdude1968 (AT) gmail (DOT) com wrote:
...
http://ant.apache.org/manual/using.html

As you can see, it makes no mention of MANIFESTS.

Why would the authors go through the trouble of creating a sample
build.xml file if they knew that an important component was missing?

Maybe they meant you to specify the main at runtime
(as I suggested earlier), or the project is normally
launched via. webstart (no manifest required) or it
is an applet (no manifest required).

I suppose that if you are using the same build file for multiple

programs, such as what I am using it for, allowing for a dynamic main
would be better. However, I was able to make my build file accept a -D
property and use it to create the manifest dynamically.
Back to top
Oliver Wong
Guest





PostPosted: Wed Apr 18, 2007 3:24 am    Post subject: Re: Creating Webmessenger Reply with quote

"Prince of Code" <princeofcode (AT) gmail (DOT) com> wrote in message
news:1176377853.563822.211340 (AT) n76g2000hsh (DOT) googlegroups.com...
Quote:
Hey all,

I am planning to develop a webmessenger for my medium scale company
with Java Applet & Servlet. The Idea would be like There will be a
servlet powerfull enough to interact with applet and make my objective
done. Does this make sense ?

It's doable, but sounds painful.

Quote:
I am suspecious about is Is there some
web messenger OSS out there. So that i can tweak it to my needs. Pls
point me if you know something like that.

Did you try googling for "open source webmessenger"?

- Oliver
Back to top
Guest






PostPosted: Wed Apr 18, 2007 5:08 am    Post subject: Re: Design with a GUI Reply with quote

Lew wrote:
Quote:
banansol (AT) hushmail (DOT) com wrote:
I wonder how one should design programs an OO way when you want to
have a GUI (Swing). Let's take a simple example, say I'm making a
program that checks if a list of servers are up. If I don't think
about the GUI I could make a Server class, and then some class
ServerCheck (or something) that contains an array with Server objects
and metods that can check if they are up and so on.
But now if I want to have a GUI, say, a JPanel that conains a JList
that has all servers in it, how should one design that? Should I
continue from where I am now in the design process and add classes
that inherit from JPanel and such,

In addition to Ed's excellent advice, you should continue from where you are
but not inherit from JPanel and such.

You have built what is called a "model" - pure logic independent of the view
into its information.

The GUI is the "view" part; it can use a model to "feed" it information that
it then displays. Many Swing components explicitly use a XxxModel in this way.

So all you do is have your, say, JList
http://java.sun.com/javase/6/docs/api/javax/swing/JList.html
use an array or a
http://java.sun.com/javase/6/docs/api/javax/swing/ListModel.html

built from your existing logic.


I just want to thank you Lew, Ed and Eric for helping me out!
It really helped, thanks!
Back to top
Andrew Thompson
Guest





PostPosted: Sun May 13, 2007 5:01 pm    Post subject: Re: Effect of adding and EventListener twice Reply with quote

Ravi wrote:
Quote:
What is the effect if I add EventListeners (like ActionListener)
twice to an Object (like JButton or Button)?

Good question. What happened when you tried it?

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-setup/200705/1
Back to top
Eric Sosman
Guest





PostPosted: Sun May 13, 2007 6:07 pm    Post subject: Re: sorting the content of a file with 60000 column? Reply with quote

saturnlee (AT) yahoo (DOT) com wrote:
Quote:
I have to sort the content of a file in sequence number order.
The sequence no is not in order.

The file is in the following format

Sequence no time
**********************************
1 80
66 333
566 656
2 56566
526 1212
....


there 're around 60000 rows of data in the file.
If i store every row in array and then sort it, then i need 60000
rows. it will not be very efficient.

What's the best way to sort it?

Store the rows in an array or in a List, and sort
them with Arrays.sort or Collections.sort.

While you are reading the rows to store them, you
may want to transform them into a more compact and easier-
to-use form. For example, you might create a

class RowData {
private final int sequence;
private final int time;
...
}

object for each row you read, and then work with the RowData
objects thereafter. Whether this makes sense depends on what
you need to do with the contents of the rows.

--
Eric Sosman
esosman@acm-dot-org.invalid
Back to top
Patricia Shanahan
Guest





PostPosted: Sun May 13, 2007 6:16 pm    Post subject: Re: sorting the content of a file with 60000 column? Reply with quote

saturnlee (AT) yahoo (DOT) com wrote:
Quote:
I have to sort the content of a file in sequence number order.
The sequence no is not in order.

The file is in the following format

Sequence no time
**********************************
1 80
66 333
566 656
2 56566
526 1212
....


there 're around 60000 rows of data in the file.
If i store every row in array and then sort it, then i need 60000
rows. it will not be very efficient.

Why would it be inefficient? You could represent each row by an object
with two int fields, 8 bytes plus the object overhead for each row.

Patricia
Back to top
TideRider
Guest





PostPosted: Sun May 13, 2007 7:50 pm    Post subject: Re: sorting the content of a file with 60000 column? Reply with quote

<saturnlee (AT) yahoo (DOT) com> wrote in message news:1179040460.365653.199590 (AT) w5g2000hsg (DOT) googlegroups.com...
|I have to sort the content of a file in sequence number order.
| The sequence no is not in order.
|
| The file is in the following format
|
| Sequence no time
| **********************************
| 1 80
| 66 333
| 566 656
| 2 56566
| 526 1212
| ....
|
|
| there 're around 60000 rows of data in the file.
| If i store every row in array and then sort it, then i need 60000
| rows. it will not be very efficient.
|
| What's the best way to sort it?
|
| Any suggestion?

Read each line's data into a SortedMap, then traverse it with an iterator to write the output file.

You will collect the entire file in some kind of collection anyway (for a collection that CAN be
contained in memory), so choose one that builds in sorted order rather than one which requires
massive reorganization after all the elements have been loaded.

--
TideRider
Back to top
Joshua Cranmer
Guest





PostPosted: Sun May 13, 2007 10:12 pm    Post subject: Re: sorting the content of a file with 60000 column? Reply with quote

saturnlee (AT) yahoo (DOT) com wrote:
Quote:
I have to sort the content of a file in sequence number order.
The sequence no is not in order.

The file is in the following format

Sequence no time
**********************************
1 80
66 333
566 656
2 56566
526 1212
....


there 're around 60000 rows of data in the file.
If i store every row in array and then sort it, then i need 60000
rows. it will not be very efficient.

What's the best way to sort it?

Any suggestion?


I don't know of the algorithms off the top of my head, but Donald Knuth
has several ways to do this efficiently. For more information, see The
Art of Computer Programming, Vol. 3: Searching and Sorting (any
edition), and check towards the back of the book for optimized sorting
on tape drives.
Back to top
Ian Wilson
Guest





PostPosted: Tue May 15, 2007 2:10 pm    Post subject: Re: spinner help Reply with quote

beelzibub @ bawston school for idiots wrote:
Quote:
... i want to make a spinner that selects the time.must i enter
all selectable times manually??


Good grief no. Use an appropriate SpinnerModel.

http://java.sun.com/docs/books/tutorial/uiswing/components/spinner.html

http://java.sun.com/javase/6/docs/api/javax/swing/SpinnerDateModel.html

http://www.roseindia.net/java/example/java/swing/ShowTimeJSpinner.shtml

I've not tried this, but it superficially looks like a workable method.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Goto page Previous  1, 2, 3 ... 58, 59, 60 ... 62, 63, 64  Next
Page 59 of 64

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.