Castor Tack

Ranch Hand
+ Follow
since Dec 06, 2010
Merit badge: grant badges
For More
127.0.0.1
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Castor Tack

Wim Vanni wrote:It's not uncommon to work with the MVC design pattern: Model-View-Controller. Several available frameworks include this pattern in one way or another: Spring, Vaadin, ...
It seems appropriate to me to get your head around this (and other) design pattern(s) and see how they help you keep your (web) application tidy and organized. In case you lack the time, maybe do some tutorial exercises from Spring or another framework to learn-by-example.

Good luck with your project!
Wim



Thanks Wim. I've done some reading and am clear (I think) about the high level structure of the app.
I will still use applet. Once the user inputs data into the applet, it will communicate with the server using sockets. I guess the server side program is servlet?
Then the servlet should be responsible for updating or fetching the data in the database.
12 years ago
Hi All:

Here's my problem:

I'm learning to build an GUI application embedded into a web page. When a user interacts with the GUI application, the application sends the inputs of the user into a database and gets the data requested by user.

I think the GUI application should be applet. But I've done some reading and see people claiming that applet cannot successfully manipulate databases due to security issues. Some say that I need to use servlet to access database.

I'm a bit confused. Should it be:
user ---> applet ---> servlet ---> database file ?


Please give me some ideas of yours as to what the flow diagram should look like.


Also, if you could share with me a similar raw project that has a framework ready, I'll appreciate it. I just need some starting point.

Thanks in advance.
12 years ago
Hi there:

I know that IOException is a general exception. I'm getting one. What types of errors does the IOException class cover?
For example: when I get FileNotFoundException, I know the file doesn't exit because that's the type of error the class covers.


Thanks
13 years ago
Hi all:

I know that it's technically wrong to say "executable" for a java application. But, how can I publish an application?

Say, I've written a project in java, and it has multiple files. I compile it, and have .class files. I then run the .class files, I see the application launched. But is there any way to convert (or whatever) all the .class files into one file(for instance, a .jnlp file) so that people can run it directly using jvm?

An example would be this:
http://download.oracle.com/javase/tutorial/uiswing/examples/components/index.html#Converter


When you click "launch", a jnlp file is actually downloaded or run, depending on user's choice. How can I make my project into a similar form so that people can directly run it from my site?

Thanks for any inputs.
13 years ago
Hi,

I have no problem using repaint(). But I'm curious to know what it does inside.
Does it simply call the paintComponent() method again or do something special?
I can't imagine how the program will know what and how to repaint if it doesn't call my overridden paintComponent() method

Thanks for any explanations.
13 years ago
Hi there:

How can I do what the title says?

For example, I create three buttons: "Edit Mode", "Watch Mode", "Draw Shape"

I know that I need to use toggle button for the first two (user can be in only one mode at a time).

What I want is, all three buttons are shown on a GUI, but the third button is activated (for users to press) ONLY when the first toggle button is pressed.

What button type should I use to define "Draw Shape"? And How?

If there's any link to how I do it, it's also appreciated.

Thank you.
13 years ago
I've figured it out. Never mind.
13 years ago
Hi there:

I'm building a mouse action handler which has the interface of MouseHandler, but I'm not clear what I am supposed to do in the implementation of the method makeActive() in the MouseHandler interface.

Could anyone tell me what purpose that method is for?
Thanks for any inputs.
13 years ago
Hello all:

Where can I find a simple GUI program that does the following thing:
1. contain some object (object's details like shape, color, don't matter, It can be a circle, square, line, whatever)
2. user can select the object by clicking on it
3. user can drag the object and move it while clicking on it

I just want a sample program to get myself started.
Thank you in advance for any inputs.
13 years ago
Many thanks to both of you.

I think I'm clear now.

And for the extended question, I did an experiment. Everything the son class inherits from father is within his own domain, i.e. when son is created, a deep copy (instead of shallow copy) of all data members in father is created.
13 years ago
Ok, I think I'll first try int-based graphics, and if it doesn't work out, I'll consider switching.
13 years ago
Hi, all:



My question is: does class Son has the private int variable key?
I think Son should has his own int variable key, but I don't when I try to do manipulateKey(), eclipse gives error, saying that key is a private member of Father. Now I get confused: Son does or does not have his own key?

I tried to change the private modifier before key in Father to public, and I can do manipulateKey(). But does that mean I'm actually manipulating Father's key instead of Son's key?

And an extension to the problem: if key is a reference to a class, does that mean there's only one copy of date in memory and I change its value when I call manipulateKey() in both Son and Father? (Let's make father non-abstract now and add method manipulateKey() into it)

Thanks for your help.
13 years ago
Something to add:
I've also found a version of drawString that takes float to indicate the locations:
Graphics2D --- drawString

So is swing/awt really based on pixels? If not, what is swing/awt base on? I'm confused.
13 years ago