• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Jeremiah

[java] textarea

13 posts in this topic

Im trying to create a java applet to serve as the client to a program I am making. I want to be able to do like Yahoo and other chat places do their text. It looks to me like they place their text inside a textarea, but how do they get other attributes? for example, choosing different fonts, and different colors, and font sizes, background, pictures, etc. How could I create a similar "textarea" for use in my project.
0

Share this post


Link to post
Share on other sites
I think this is a job for styled documents.
http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html
I''ve never actually done anything with them but I think that''s what you need. There is an example that comes with the jdk in which you can change the font and color of text, and insert images.
0

Share this post


Link to post
Share on other sites
I may have overlooked it, but I couldnt find the information
I needed on the URL you gave.

It seems like it would be pretty simple, but I just cant seem to find source so I can change font attributes [color, etc] and insert pictures inside a textarea.

maybe they use something other than textarea?
0

Share this post


Link to post
Share on other sites
You''re not looking for textarea stuff. You should be looking for styled document stuff. There''s an example in the jdk distributuion
\demo\jfc\StylePad\
java -jar Stylepad.jar

I''m sure that is for what you are looking, right?
0

Share this post


Link to post
Share on other sites
couldnt look at it tonite, but if Im not mistaken, swing is for Java 1.2 and greater, I was just curious which browsers support Java 1.2 and greater?

0

Share this post


Link to post
Share on other sites
Well, none right now. That''s why we have the Plug-In available for most platforms. Now, most probably, future versions of the browsers will support JDK 1.2, but until then you have to learn how to deal with the nuances of the Plug-In, which in my opinion, is still new technology and has plenty of problems.

JoeG
0

Share this post


Link to post
Share on other sites
then how does Yahoo.com chat do their java chat clients?

They have colored text, and images inside their "textarea".

There must be a way to do this under Java 1.0 then right?

0

Share this post


Link to post
Share on other sites
What if I tried to create my own textarea from the classes that textarea get its inheritance from? would that be possible, and then I could add in colored text?

Somebody suggested using a Canvas to impersonate a textarea, but that way I could do anything to it, colored text, pictures, anything. How would I implement this?
0

Share this post


Link to post
Share on other sites
I don''t imagine that there would be any problem with you just using the javax.swing.text package and just including it in your distribution. Most of the stuff you need are interfaces, and the concrete implementations directly extend java.lang.object. If not, you can still look at the source for ideas on what methods to use if you are going to extend textarea yourself.
0

Share this post


Link to post
Share on other sites
Just run java -verbose yourApp.class and capture the output. What you see is a list of all the classes that you''re app loaded. Finding these classes in the class hierarchy is an entirely different problem though.
0

Share this post


Link to post
Share on other sites

>I don''t imagine that there would be any problem with you
>just using the javax.swing.text package and just including
>it in your distribution.

The main reason I dont want to use Java 1.1, 1.2, 2.0, or swing is because it is going to be an applet. I need it to be small and use Java 1.0

I''ll try and see if I can find the appropriate classes
so I can extend textarea to include colored fonts and images.

thanx for all the advice and replies.
0

Share this post


Link to post
Share on other sites
If you''re using 1.0 there''s not going to be any API or class that you can use, you''re gonna have to code your own component. Good luck hadling events.
0

Share this post


Link to post
Share on other sites
Actually java1.1 is supported by the major browsers. The event handling there is a lot more nicer than it was with java1.0

JoeG
0

Share this post


Link to post
Share on other sites
well, I''m beginning coding it today...

Its going to have a canvas, and a scrollbar.

The part Im trying to figure out is this:
I am going to need to know the total height of the
"textarea" information, so I can deal with the scrollbar.

but this isnt as easy as it sounds. because Im going to be
using different fonts, and each font takes up different amount of space. some are fixed-width, and some arent.
And then if I add in images, I''ll hafta add them into figureing out the hieght.

what should I have the "textarea" contents stored in?
How should I store it, so I can store the color of different words and images and such?
0

Share this post


Link to post
Share on other sites