• (3 Pages)
  • +
  • 1
  • 2
  • 3

Creating a basic Notepad Application Rate Topic: ***** 5 Votes

#31 arashzz  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 39
  • Joined: 28-September 09

Posted 14 December 2010 - 01:44 PM

View Postjumptrooper, on 22 August 2010 - 06:32 PM, said:

I went through and coded this tutorial and like I said before, you did a great job. I did, however, find something interesting and I'm wondering if you might be able to explain it for me.
Whenever I exited the program using the "close" menu item, the window would disappear but the process would continue to run. I kept having to manually terminate the program from the command line. I modified the relevant portion of the event handler to say:
// if the source of the event was our "close" option
		if(e.getSource() == this.close){
			this.dispose();  // dispose all resources and close the application
			System.exit(0);
		}

And this fixed everything (I can actually get rid of the this.dispose(); line altogether and it works fine too). I did this on an Ubuntu linux computer - could that have anything to do with it? Is "this.dispose();" supposed to terminate the program or just visually remove the window and all its resources?

Did anyone else run into this?


The close menu item worked perfectly for me and terminated the process as it should, not sure why it didn't work for you.
Was This Post Helpful? 0
  • +
  • -

#32 vikramsehgal  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 29-September 11

Posted 29 September 2011 - 09:49 AM

Hey Guys
I did not understand those codes properly so can please anyone explain me. :plain: :blush: :blush:
Was This Post Helpful? 0
  • +
  • -

#33 RepeatingYesterday  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 12-October 11

Posted 12 October 2011 - 07:48 PM

Thank you for posting this great tutorial. We are going over reading/writing to Files in my Object Oriented Programming class, and this really helps me put what is going on together.
Was This Post Helpful? 0
  • +
  • -

#34 tiarasalmi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 06-February 11

Posted 23 March 2012 - 01:52 AM

how to create a program codings that can write into Microsoft Word....using Java
Was This Post Helpful? 0
  • +
  • -

#35 dougyno1  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 77
  • Joined: 06-May 11

Posted 29 March 2012 - 12:59 PM

Great tutorial :),

nice commenting through the syntax, explained everything, great for my refreshment on java as well.
Was This Post Helpful? 0
  • +
  • -

#36 OKIEWARDOYO  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 51
  • Joined: 03-April 12

Posted 30 May 2012 - 11:59 AM

i have some questions about this
1. How to set window title right afgter saved?
2. when i click save or open, the file browser lookk like java native browser, i'm using windows, can we user file browser for windows?
3. after saving , when we want to edit and click save again, it still open file browser location to save again.
how to solve this?
Was This Post Helpful? 0
  • +
  • -

#37 JPNicole  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 12-February 12

Posted 11 June 2012 - 05:34 PM

Hey gabehabe,

This was awesome! I just got a taste for java several months back and then had to take some time off. I was starting to forget the little I had learned when I stopped and did your tutorial. Even though, you had it so I could cheat and just copy and paste the code, I sat down and typed it all out. What a refresher for me as well as a learning experience. You saved the day....

Also, I didn't really read the replies you got, but I ran it from the command prompt the first time. Thanks, I already for use for this beyond the tutorial...
Was This Post Helpful? 0
  • +
  • -

#38 xghostchantx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 18-May 12

Posted 19 June 2012 - 08:16 PM

I wrote everything exactly as it is laid out in the tutorial, however I am unable to run the program.

I get the following error:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 

	at Notepad.main(Notepad.java:9)


Wondering how I can fix this.
Was This Post Helpful? 0
  • +
  • -

#39 JavaT  Icon User is offline

  • D.I.C Head

Reputation: -10
  • View blog
  • Posts: 70
  • Joined: 21-February 11

Posted 23 June 2012 - 04:17 PM

Thanks. I'm following this now.
Was This Post Helpful? 0
  • +
  • -

#40 vbabey  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 73
  • Joined: 30-July 12

Posted 17 August 2012 - 05:02 AM

This is a nice tutorial...I think you can add some features here....
Was This Post Helpful? 0
  • +
  • -

#41 Betrayal  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 29
  • Joined: 09-March 12

Posted 20 August 2012 - 01:28 PM

Hmm, this was a splendid tutorial! Is there an easy way to make the default file extension for saving in the ".txt" format?
Was This Post Helpful? 0
  • +
  • -

#42 Mike+9  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 104
  • Joined: 10-July 12

Posted 04 September 2012 - 12:28 AM

Hey thanks a lot for this tutorial. It was very easy to understand and it also leaved a lot of things for me to try to add to it like a spell checker, an option to first save the file and then close the app, a font changer and other stuff like that.
Was This Post Helpful? 0
  • +
  • -

#43 Zuelajindi  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 80
  • Joined: 09-October 12

Posted 23 October 2012 - 11:36 PM

Is there a better way to understand this, rather than mindlessly following the coding? I have never done GUI before.
Was This Post Helpful? 0
  • +
  • -

#44 Brainpower49  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 04-February 13

Posted 04 February 2013 - 08:05 PM

Really nice tutorial!
I learned more about the GUIs and how IO works a bit.
Plus, I've learned a bit about MenuItems.
Again thanks for this tutorial.
Im probably going to modify this as much as I can to gain a bit more understanding of it.

NICE TUTORIAL gabehabe!
Was This Post Helpful? 0
  • +
  • -

#45 imrealashu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-July 13

Posted 09 July 2013 - 02:08 AM

The save is like "Save As" because every time it asks for new file name to save.
how to save like
If (file exist)
then
overwrite
else
(ask for new file name)


and If we include "New" sub menu
then the actionPerformed code will be ???
please help???
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3