473,394 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

help with mousemove/mousedrag program

Basically i want to use this idea shown here

http://javaboutique.internet.com/tutorials/Java_by_Example/section6_3.html

I just wasnt sure what was required in the main method. I want it to bring up the window in which to draw in.

As an afterthought i was wondering if you could modify the code so that:
i) You could save what was drawn
ii) The user could select which colour and thickness to draw in.

I tried doing a basic main method but it didnt work. I am very much a novice at this so much help would be appreciated.

i wrote:

Expand|Select|Wrap|Line Numbers
  1.        public static void main(String[] args) {
  2. Applet gBuffer=new Project29();
  3.  
  4.  gBuffer.addWindowListener(new WindowAdapter() {
  5.        public void windowClosing(WindowEvent e) {
  6.           System.exit(0);
  7.        }
  8.     });
  9.     gBuffer.setSize(350,200);
  10.     gBuffer.setVisible(true); 
  11. }
Feb 6 '08 #1
4 1807
r035198x
13,262 8TB
Basically i want to use this idea shown here

http://javaboutique.internet.com/tutorials/Java_by_Example/section6_3.html

I just wasnt sure what was required in the main method. I want it to bring up the window in which to draw in.

As an afterthought i was wondering if you could modify the code so that:
i) You could save what was drawn
ii) The user could select which colour and thickness to draw in.

I tried doing a basic main method but it didnt work. I am very much a novice at this so much help would be appreciated.

i wrote:

Expand|Select|Wrap|Line Numbers
  1.        public static void main(String[] args) {
  2. Applet gBuffer=new Project29();
  3.  
  4.  gBuffer.addWindowListener(new WindowAdapter() {
  5.        public void windowClosing(WindowEvent e) {
  6.           System.exit(0);
  7.        }
  8.     });
  9.     gBuffer.setSize(350,200);
  10.     gBuffer.setVisible(true); 
  11. }
Is that all you have done so far? Please post all the code you have tried so far. This sounds like a school project to me.
Feb 6 '08 #2
well its all ive done for the main method. not really sure what is involved as this is a totally new idea for me. the rest of the code is the same as the stuff in the link which compiles fine. just dont know how you actually get the window up to draw in
Feb 6 '08 #3
r035198x
13,262 8TB
well its all ive done for the main method. not really sure what is involved as this is a totally new idea for me. the rest of the code is the same as the stuff in the link which compiles fine. just dont know how you actually get the window up to draw in
Well, I don't trust external links. I know some who don't too.
You are better off grabbing a tutorial (Sun's Java one is nice) and trying whatever you want to do by yourself. If you get stuck, you can then post your code here and the experts will be willing to help.
Feb 6 '08 #4
BigDaddyLH
1,216 Expert 1GB
Basically i want to use this idea shown here
Expand|Select|Wrap|Line Numbers
  1.        public static void main(String[] args) {
  2. Applet gBuffer=new Project29();
  3.  
  4.  gBuffer.addWindowListener(new WindowAdapter() {
  5.        public void windowClosing(WindowEvent e) {
  6.           System.exit(0);
  7.        }
  8.     });
  9.     gBuffer.setSize(350,200);
  10.     gBuffer.setVisible(true); 
  11. }
I think you are confusing applets with stand-alone GUIs. As suggested, take the Sun Swing tutorial: http://java.sun.com/docs/books/tutor...ing/index.html
Feb 6 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
1
by: Fu Chen | last post by:
Hi! I am designing a graphics editor in c#. I face a trouble, if i drag a complex graphics item, it will be impossible to draw it once between two movemove event. But in normal solution, movemove...
0
by: Sam Sungshik Kong | last post by:
Hello! If I understand correctly, MouseMove event is triggered when the mouse moves (ie when point changes). I, however, found out that it's triggered even if the mouse is not moving. What I...
4
by: Colin McGuire | last post by:
Hi, this is a really simple question I have been banging my head on a brick wall over. The program below changes the background colour of a form depending on whether the cursor is inside a...
2
by: Kruno | last post by:
Hi, I need to close main win form after some time inactivity. Users mostly do the work only with the mouse. It's possible to handle mouse move event on application level? Because I don't like...
3
by: TyBreaker | last post by:
I'm writing a screen saver using Visual Studio 2005 (Basic) and I have a Form which contains a PictureBox. I have two events, Click and MouseMove that I'd like to cause the program to end (see...
1
by: Dave | last post by:
I have a listview control in a form, and I use the mousemove event (to set a tooltip). This worked fine in VS2003, but when I ported it to VS2005 I found that when the mouse hovers over a populated...
2
by: Poppa Pimp | last post by:
ImageResizer.php Image Resizer PLEASE HELP The URL of the page this is on in my site is http://poppa-pimps-wallpapers.com//ImageResizer.php You can click on browse and get image,but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.