Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Simple Text Editor

java

  • Please log in to reply
31 replies to this topic

#13 Turk4n

Turk4n

    ???

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1919 posts
  • Location:Sweden
  • Programming Language:C, Java, PHP, Python, Bash
  • Learning:C++, C#, JavaScript, Visual Basic .NET, Others

Posted 25 October 2009 - 10:57 AM

Thanks mate...worked perfectly and I understand GUI's quite a bit, and this is my first time using a GUI, thank you so much.


No problem :)
  • 0

#14 miami

miami

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 11 February 2010 - 12:34 AM

where is the class "New" implementation ?
  • 0

#15 Turk4n

Turk4n

    ???

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1919 posts
  • Location:Sweden
  • Programming Language:C, Java, PHP, Python, Bash
  • Learning:C++, C#, JavaScript, Visual Basic .NET, Others

Posted 11 February 2010 - 01:03 AM

where is the class "New" implementation ?


Pardon?
  • 0

#16 miami

miami

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 11 February 2010 - 08:02 AM

this part right here --> file.add(New);


where is the definition for that object "New"
  • 0

#17 Turk4n

Turk4n

    ???

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1919 posts
  • Location:Sweden
  • Programming Language:C, Java, PHP, Python, Bash
  • Learning:C++, C#, JavaScript, Visual Basic .NET, Others

Posted 11 February 2010 - 08:10 AM

this part right here --> file.add(New);


where is the definition for that object "New"


Ah, you meant the "New" part, well...
Action New = new AbstractAction("New", new ImageIcon("Path/image.gif")) {
		public void actionPerformed(ActionEvent e) {
			saveOld();
			area.setText("");
			currentFile = "Untitled";
			setTitle(currentFile);
			changed = false;
			Save.setEnabled(false);
			SaveAs.setEnabled(false);
		}
	};
New is an action that creates a new abstract-action we use to create new document or whatever so.
  • 0

#18 ip4ndz

ip4ndz

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 10 March 2012 - 01:31 AM

Great tutorial, but i have another problem when i create confirmation dialog using JOptionPane YES_NO_OPTION on saveFileAs() method. I want to add warning message with confirm dialog, when there is an existing file name, like in notepad, but still a little problem when user press no button.

//method1
	private void saveFileAs() {
		if (dialog.showSaveDialog(null)==JFileChooser.APPROVE_OPTION) {
				if (dialog.getSelectedFile().exists()) {
					Object[] options = {"Oh, yeah",
	                        "No, thanks",
	                        };
				   
					int n = JOptionPane.showOptionDialog(null,
				                    dialog.getSelectedFile()
				                    + " already exist \n"+"Do you want to replace it? ",
				                    "Confirm Save As",
				                    JOptionPane.YES_NO_OPTION,
				                    JOptionPane.QUESTION_MESSAGE,
				                    null,
				                    options,
				                    options[1]);
				    if (n == JOptionPane.YES_OPTION) {
				    	saveFile(dialog.getSelectedFile().getAbsolutePath());
				    } else if (n == JOptionPane.NO_OPTION) {
				    	dialog.showSaveDialog(null);
				    	saveFile(dialog.getSelectedFile().getAbsolutePath());
				    } else {
				        dialog.cancelSelection();
				    }									
				}
			
		}
		
	}

Any suggestion on how to fix this? I have searched through search engines, how to fix this problem, but I didn't found anything.

Any help would be much appreciated.
  • 0

#19 kmai

kmai

    CC Lurker

  • New Member
  • Pip
  • 5 posts
  • Programming Language:Java
  • Learning:C, Lisp

Posted 08 August 2012 - 04:51 AM

Your variable naming conventions don't conform to Java standards.
  • 0

#20 Eric2241

Eric2241

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Programming Language:Java, Objective-C, (Visual) Basic, JavaScript, Visual Basic .NET, VBScript, Others
  • Learning:C, Java, C++, Objective-C, PHP, (Visual) Basic, Python, JavaScript, Visual Basic .NET, Bash, VBScript, Others

Posted 03 November 2012 - 11:00 AM

Thank you so much i use some of the code in my Text Editor don't worry I gave you credit
  • 0

#21 sgaldorJasonStorm

sgaldorJasonStorm

    CC Lurker

  • New Member
  • Pip
  • 7 posts

Posted 06 December 2012 - 10:28 AM

Maybe it's just my noob-ness, but I couldn't find the complete source or an executable jar for this project. It looks like a perfect project for me to study and learn from.
  • 0

#22 vikram0123

vikram0123

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 09 April 2013 - 09:12 AM

Firstly thank you for the tutorial, I wanted to ask if I could have your permission to use this example for further development on my final year project. I do not wish to fall in the lines of plagiarsim and would be greatful if I could get your permission.

 

Thank You


  • 0

#23 Turk4n

Turk4n

    ???

  • Expert Member
  • PipPipPipPipPipPipPip
  • 1919 posts
  • Location:Sweden
  • Programming Language:C, Java, PHP, Python, Bash
  • Learning:C++, C#, JavaScript, Visual Basic .NET, Others

Posted 09 April 2013 - 09:46 AM

Firstly thank you for the tutorial, I wanted to ask if I could have your permission to use this example for further development on my final year project. I do not wish to fall in the lines of plagiarsim and would be greatful if I could get your permission.

 

Thank You

Of course, feel free to use it as you please :-)


  • 0

#24 JasonKnight

JasonKnight

    CC Addict

  • Senior Member
  • PipPipPipPipPip
  • 312 posts
  • Location:Keene, NH
  • Programming Language:C, C++, JavaScript, Delphi/Object Pascal, Pascal, Assembly, Others

Posted 09 April 2013 - 01:16 PM

Question, does it actually obey the system metric, or does it have the typical JAVA shortcoming of crappy illegibly undersized fonts by default on everything?

Sorry, I'm a large font/120 dpi user on most machines, Win7 Large/144 on my IPS rig. Software that's unaware of these annoys the devil out of me -- it's part of why I won't use most java based applets that have anything to do with text content.

Also, is there a reason you attached a rar with just some GIF files in it, and not a working copy of the proggy?

Edited by JasonKnight, 09 April 2013 - 01:17 PM.

  • 0
The only thing about Dreamweaver that can be considered professional grade tools are the people promoting it's use.





Also tagged with one or more of these keywords: java