Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  muffin stuff (webstart cookies)  (Read 2835 times)
0 Members and 1 Guest are viewing this topic.
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Posted 2004-08-07 08:41:52 »

Webstart demonstration:

You'll see a JFrame with a JTextArea and nothing else. Write something... close it and start it again. The text should be there again (loaded from a muffin).

The source:


On the first run the load method in MuffinStreamTest will end up in the catch block, because there isn't a muffin.

Muffins should be nicer to handle with these two classes. It should be good enough for most of the webstart apps. It's written somewhat simple minded, but why not?

Design-wise it's asymetric - I'm very sorry Tongue (it just made more sense to handle it this way). One thing worth noting... the muffin itself is actually written in the close() method, because you need to know the maximum size of muffin before writing.

You'll need either the webstart devkit (I used the jnlp.jar from "") or javaws.jar (from your javaws directory) in your classpath for compilation.

Condition of use/license:
a) don't sue me
b) use it like you want to
c) change it like you want to
d) if you find bugs or ways to improve it, let me (us) know Smiley

弾幕 ☆ @mahonnaiseblog
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #1 - Posted 2004-08-07 08:58:00 »

There is one issue with the demo...

-text is there... don't move the cursor
and the text is gone. That doen's happen if you move the cursor at least once. So it has something to do with that getText() thingy of JTextArea (JTextComponent actually).

Hmm. :-/

Guess cheap "" init plus append(thatText) hackery would help Tongue


No, I was wrong... it's something different, which I hadn't fully tracked down. After it was saved two times it won't get deleted (why?) and thus creation fails (insert failed in cache: target already exixts) and I forget to check if webstart actually granted us that much space...

uh uh... gonna post again if I got around fixing it.

Sorry Tongue

弾幕 ☆ @mahonnaiseblog
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #2 - Posted 2004-08-07 10:15:43 »

/me pukes

Quote deleted insert failed in cache: target already exixts

Haha. Very funny. Angry

Dunno what's wrong... it works nicely (=always) if I run it from my lan server Huh

And that other thing works always? I'm really somewhat puzzled right now :-/

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #3 - Posted 2004-08-07 10:36:15 »


That did the trick.

The individual entries can be tagged as either cached, meaning the server has an up-to-date copy, dirty, meaning the server does not have an up-to-date copy, or temporary, meaning that the file can always be recreated.

Well, I had to guess here Roll Eyes

But it makes some sense... some (the server doesn't have any copy at all, therefore it's as good as if it would be actually cached Tongue).

弾幕 ☆ @mahonnaiseblog
Offline Malohkan

Senior Devvie

while (true) System.out.println("WOO!!!!");

« Reply #4 - Posted 2004-08-07 17:38:53 »

I tried mimicing your MuffinStreamTest.jnlp for my own jnlp file, and so I changed the variables to fit my stuff, and opened it, and got this error:

This XML file does not appear to have any style information associated with it. The document tree is shown below

Can someone clarify what I might have done wrong?

Admin and Game Developer at
Play Rimscape!    |    Play Conquer!
Offline oNyx

JGO Coder

Medals: 2

pixels! :x

« Reply #5 - Posted 2004-08-07 18:56:52 »

The jnlp (your's) is most likely perfectly fine.

However, the server doesn't know the mime type of jnlp files. If it's free webspace... well bad luck.

If you've paid for it you'll usually have several options... some of em are outlined here:

If you can use ".htaccess" you just need to add a file with that name in the root directory (or if it already exists just append the folowing line):
AddType application/x-java-jnlp-file .jnlp

弾幕 ☆ @mahonnaiseblog
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

bilznatch (24 views)
2015-08-04 11:03:17

SHC (40 views)
2015-08-01 03:58:20

Jesse (24 views)
2015-07-29 04:35:27

Riven (46 views)
2015-07-27 16:38:00

Riven (25 views)
2015-07-27 15:35:20

Riven (27 views)
2015-07-27 12:26:13

Riven (18 views)
2015-07-27 12:23:39

BurntPizza (41 views)
2015-07-25 00:14:37

BurntPizza (54 views)
2015-07-24 22:06:39

BurntPizza (34 views)
2015-07-24 06:06:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!