Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 8th, 2006, 9:28 AM   #1
Riddick
Newbie
 
Join Date: Sep 2006
Posts: 14
Rep Power: 0 Riddick is on a distinguished road
Code Highlighting in Text Editor

Hi all this is my first post here.

Sorry if it's been asked before, i did search.

Anyway, i am developing a text editor and want to add highlighting to the syntax, to start with HTML then PHP and ASP. But not sure where to start.

I'm coding in Java using the Swing library.

Thanks
Riddick is offline   Reply With Quote
Old Nov 8th, 2006, 9:52 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Is there an actual question in there somewhere?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Nov 8th, 2006, 10:19 AM   #3
Riddick
Newbie
 
Join Date: Sep 2006
Posts: 14
Rep Power: 0 Riddick is on a distinguished road
Sorry,

I am developing a text editor and i want to add highlighting to the source code. But i'm not sure how it's done.

So my question is, can anyone point me in the right direction as to how i go about it?
Riddick is offline   Reply With Quote
Old Nov 8th, 2006, 11:50 AM   #4
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 4 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
I would recommend looking at this url.
http://www.google.com/search?hl=en&l...ghting+in+Java
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Nov 8th, 2006, 2:30 PM   #5
Riddick
Newbie
 
Join Date: Sep 2006
Posts: 14
Rep Power: 0 Riddick is on a distinguished road
I've searched on google quite a bit and found plenty of examples but i just wondered if anyone had any experience in this and would be able to direct me to good method that wasn't too complicated.

I'm quite new to Java.
Riddick is offline   Reply With Quote
Old Nov 8th, 2006, 3:07 PM   #6
Narue
Professional Programmer
 
Narue's Avatar
 
Join Date: Sep 2005
Posts: 419
Rep Power: 4 Narue is on a distinguished road
>I'm quite new to Java.
And you're writing a graphical text editor with syntax highlighting...
__________________
Even if the voices aren't real, they have some pretty good ideas.
Narue is offline   Reply With Quote
Old Nov 8th, 2006, 3:47 PM   #7
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 4 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
I've been studying Java a little over a year and not that long ago was hardly able to create a basic text editor.
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old Nov 8th, 2006, 4:31 PM   #8
Riddick
Newbie
 
Join Date: Sep 2006
Posts: 14
Rep Power: 0 Riddick is on a distinguished road
I'm not new to programming.

I just wanted to use Java for the portability. I don't think changing to a different language should be too difficult.
Riddick is offline   Reply With Quote
Old Nov 8th, 2006, 5:10 PM   #9
AntiNinja
Hobbyist Programmer
 
AntiNinja's Avatar
 
Join Date: Jun 2006
Location: The States
Posts: 101
Rep Power: 3 AntiNinja is on a distinguished road
Send a message via AIM to AntiNinja Send a message via Yahoo to AntiNinja
IIRC you can highlight syntax using StringTokenizer and either the rtf or html style in a EditorPane, I dont remember exactly how but look in that direction... Search on google for a plugin or something like that.
__________________
Pain is just weakness leaving the body.
AntiNinja is offline   Reply With Quote
Old Nov 9th, 2006, 4:51 AM   #10
Riddick
Newbie
 
Join Date: Sep 2006
Posts: 14
Rep Power: 0 Riddick is on a distinguished road
Quote:
Originally Posted by AntiNinja View Post
IIRC you can highlight syntax using StringTokenizer and either the rtf or html style in a EditorPane, I dont remember exactly how but look in that direction... Search on google for a plugin or something like that.
Thanks, i've found a section in a book about this now. That's hopefully pointed me in the right direction.
Riddick is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[perl] graphical text editor glimmy Existing Project Development 0 Aug 7th, 2006 12:47 AM
Basic HTML Tutorial - Reuben Keeney ReubenK HTML / XHTML / CSS 14 Mar 26th, 2006 6:50 AM
How to detect cursor location and insert text??? syntax-error C# 3 Jun 30th, 2005 2:42 AM
Text editor source code... paperboy C++ 2 Mar 9th, 2005 3:08 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC