In search of simple java editor
Hello,
I'm currenty searching for a java component that can display images.
Preferably it has:
- zooming capabilities
- pluggable commands
I have allready tried using DisplayJAI in combination with imagefilters. The only thing missing is a simple zooming (currently, I have quality loss when zooming in and out succesively).
Does anyone know of a simple imagewidget that has these capabilities (preferably open-source)?
You could just extend JComponent and make your own class...
Similar Messages
-
Hello,
I am looking for a very simple(barebone)Java editor which can provide syntax highlighting facility. I need to plug it into my application.
Can anybody suggest me something?
Looking forward 2 ur replies.Hi,
one of the most powerful editor in Java is jEdit.
But it is not only a powerful editor you can also get its editor bean with
syntax highlighting separately from http://syntax.jedit.org/.
So you can have both: An editor to use and a component to integrate into your apps.
Bye
Frank -
Trying to find simple OSX Java Editor
Hi,
This is my first posting ... hope it's the right place. I'm new to Java - enjoying it greatly. Started on PC using JCreator as Java editor ... fast, simple to use & understanderable, get on with the job of learning ... no problem.
Now I have to migrate to mac OSX and I'm getting into trouble. JCreator is not available for OSX and all I can find are IDE's that I'm finding way too complex, fiddley and with WAY too much 'bling' for me right now. I'd be REALLY greatefull for any pointers to good, simple MAC editors.
Thanks in advance
GilesOK, I'm working my way through 'The Java Tutorial' - obviously download examples, open JCreator and can immediatly compile & run them, it dosn't change the example in any way NetBeans, by comparison seems to want me to set up a project, it adds a whole load of stuff that I don't understand yet.
-
Efficient data structure to implement simple text editor?
I was given this problem in an interview:
What data structure would you use to implement a simple text editor that does these 4 functions:
a) goto(line number)
b) insert(char input,location)
c) delete(location)
d) printAll() //print entire file
Given that i'm such a newb, i was stumped. I came up with making a 2d array that would allow for o(1) time for goto, but o(n) for everything else (shifting everything in the array). there were other downfalls too dealing with space issues and such, but he wanted me to optimize this data structure. I then came up with a linked list of arrays, but that had similar problems.
But thinking about it further is driving me a little crazy so I'm wondering if you guys have any suggestions on how to answer this question...
one thing that came to mind after is to implement the data structure as a binary tree, where each node contains
class Node
char theChar
int position; // ie 0 = first character in the file, and 81 could be the first character in the 2nd line
node left,right,parent;
}so how it works is the cursor would know where the location was so i would know where to delete and insert within the tree.
insert {
//search for location to insert after (log n)
//create new character node and append to current node
//increment position for all subsequent children
delete(x) {
search for x position
if found, remove node and decrement position value for all children
goto(line #) {
return line # * 80 (or whatever max length for a single line)
}the major problem i see here is balancing the tree after every insert/delete
Thanks in advance.One of many great things emacs has given us is the gap buffer:
http://en.wikipedia.org/wiki/Gap_buffer
To see a Java implementation of this you can look in the Java SDK source. The document model (I forget exactly what its called), used in Swing uses a gap buffer. -
Which is the Best Java Editor?
I am a new java programmer? which is best editor to develop enterprise solution?
I heard about Eclipse,NetBeans,JBuilder which is better?
AravindWhen you get a few days/weeks of down time, do a search on this forum for best IDE and read all about everyone's opinions. This question is constantly asked. And then after you've read all the possible arguments for each one and your head is spinning learn to use the command line tools to compile and run while writing code in a simple text editor of your choice.
-
sandy - a simple text editor
Sandy is a X11 text editor with an easy-to-read, hackable C source. It uses GTK+ and GtkSourceView for convenience and is akin to surf, only it is a text editor, not a web browser. Sandy tries to maximize screen estate, minimize the SLOC used and not get in your way too much. It can somehow be controlled via XProperties and all preferences and keybindings are to be chosen at compile time. Two example configs are provided with the source.
Features
- Basic editing, saving, etc.
- One document per instance
- Embeddable (e.g. can use http://tools.suckless.org/tabbed for tabs)
- Regex search, go to line functionalities
- Pipe selection through arbitrary command
- Pipe selection through predefined command(s)
- Syntax highlighting
- Line numbers, current line highlightnig
- Simple autoindenting
- Multi-level undo
- Configurable at compile-time
Dependencies
- GtkSourceView2
- Gtk+2
- (probably) xorg-utils to get xprop to set XProperties
- one method to grab user input: either zenity or dmenu in the pre-defined config files
Screenshot
http://sandyeditor.sf.net/sandy_editor.jpeg
Homepage
http://sandyeditor.sf.net/
Download
http://sourceforge.net/projects/sandyed … z/download
AUR
http://aur.archlinux.org/packages.php?ID=36084
Comments, bug reports and patches welcome.
Last edited by rafunchi (2010-04-13 23:24:26)Procyon wrote:
It would be nice to be able to do something like this:
1 abc
2 dec
3 abd
4 edc
5 {CURSOR}ad
^R, sed command: 1,3s/^/%%%/
1 %%%abc
2 %%%dec
3 %%%abd
4 edc
5 {CURSOR}ad
So you can edit and continue where you left off.
The problem with implementing this behavior is 'sed' is an external command here. The full text is filtered through sed and put back in the buffer, not just lines 1 to 3. You can't just preserve the insert position as the text coming from the pipe might be completely different from your original. Same for searching the current line.
You *could* remember your line+char position and move the cursor back there, but this would be highly unreliable and move the cursor to a third position in the buffer if your 's' command changes the number of lines (e.g. try s/:/\n/g in a password file)
Also, a couple of tests with vim prove that it does not behave consistently in this regard, despite :s being an internal command there.
if you really want to add '%%%' at the beginning of the line quite often, I suggest you define a binding or action for:
t_editable, t_pipelines, { .v = (char *)"sed \'s/^/%%%/\'" }
Then select the lines you want to target lousily (you don't need to select full lines) and launche the binding/action. It does move the cursor, but seems fairly quick.
Procyon wrote:Maybe you can check for "/^s/" in the command to make it work on this current line, just like vim's :s///
I made a wee change in the hg tip code. Now sandy "listens" to three properties regarding pipes:
- _SANDY_PIPE: Pipes the selected text, or nothing by default as per f_pipe. This is used by the ^I binding in the default config.
- _SANDY_PIPEALL: Pipes the selected text, or the full file if nothing is selected as per f_pipeall. This is used by the ^P binding in the default config.
- _SANDY_PIPELINES: Pipes the selected text, extending the selection to full lines and matching the current line if there is no selection as per f_pipelines. This is used by the ^R binding in the default config. This means now sed is applied to full lines if there is a selection and to the current line if there is not.
Thanks for your feedback. I hope this helps. -
Is there a simple, FREE, XML editor out there (written in Java)?
I am using an XML file format for a small application I wrote, and I would prefer to edit the file using an XML editor, since it is easy to screw up the file in a text editor.
If you've used Forte or Netbeans, all I want is a simple XML editor like the one that is built into the IDE.
Thanks for any information.Vim works pretty good, its free, and has syntax highlighting. You would need to be familiar with using vi. http://www.vim.org/
If you use Eclipse, you can get http://www.oxygenxml.com/. It's not free, but its cheaper than XMLSpy.
I haven't found anything better than XMLSpy, even though its expensive.
Does anyone know of another tool that can generate a sample instance document from a schema, and/or a schema from an instance document? I find that handy in XMLSpy.
-Scott
http://www.swiftradius.com -
How can I add highlighting to my simple text editor?
Hi ...I wrote a simple text editor ..but I want to add Sysntax highlihting to my editor ...ilke I will enter some words in sourse code (new..import.. ext ) and when I write in text those words I want to see whit a different collor ..how can I do this? here is source codes for my text editor..and I want your help
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.plaf.ComponentUI;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.*;
import java.util.regex.*;
public class JText extends JFrame{
private JTextArea textarea ;
private JFileChooser fileChooser = new JFileChooser();
private Action open =new OpenAction() ;
private Action save = new SaveAction();
private Action exit = new ExitAction();
public static void main(String args[])
JText pencere= new JText();
pencere.setBackground(Color.lightGray);
pencere.setSize(400,300);
pencere.setVisible(true);
//Text Area
public JText(){
textarea = new JTextArea(15,90) ;
JScrollPane scroll = new JScrollPane(textarea);
JPanel content = new JPanel();
content.setLayout(new BorderLayout());
content.add(scroll, BorderLayout.CENTER);
//Menu Bar
JMenuBar menu=new JMenuBar();
JMenu file=menu.add(new JMenu("FILE"));
file.setMnemonic('F');
file.add(open);
file.add(save);
file.addSeparator();
file.add(exit);
setContentPane(content);
setJMenuBar(menu);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setTitle("Project");
pack();
setLocationRelativeTo(null);
setVisible(true);
class OpenAction extends AbstractAction {
//============================================= constructor
public OpenAction() {
super("Open...");
putValue(MNEMONIC_KEY, new Integer('O'));
//========================================= actionPerformed
public void actionPerformed(ActionEvent e) {
int retval = fileChooser.showOpenDialog(JText.this);
if (retval == JFileChooser.APPROVE_OPTION) {
File f = fileChooser.getSelectedFile();
try {
FileReader reader = new FileReader(f);
textarea.read(reader, ""); // Use TextComponent read
} catch (IOException ioex) {
System.out.println(e);
System.exit(1);
class SaveAction extends AbstractAction {
//============================================= constructor
SaveAction() {
super("Save...");
putValue(MNEMONIC_KEY, new Integer('S'));
//========================================= actionPerformed
public void actionPerformed(ActionEvent e) {
int retval = fileChooser.showSaveDialog(JText.this);
if (retval == JFileChooser.APPROVE_OPTION) {
File f = fileChooser.getSelectedFile();
try {
FileWriter writer = new FileWriter(f);
textarea.write(writer); // Use TextComponent write
} catch (IOException ioex) {
JOptionPane.showMessageDialog(JText.this, ioex);
System.exit(1);
class ExitAction extends AbstractAction {
//============================================= constructor
public ExitAction() {
super("Exit");
putValue(MNEMONIC_KEY, new Integer('X'));
//========================================= actionPerformed
public void actionPerformed(ActionEvent e) {
System.exit(0);
}i looked it ...it is the one which i want to do ..But i want to use my window which i gave above ..But i cant mix them ..:( this codes for highlighting.... is any body can add this codes and my codes which i gave above connect together? pleaseeeee... :))
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
public class SyntaxTest extends DefaultStyledDocument
Element rootElement;
String wordSeparators = ",:;.()[]{}+-/*%=!&|~^@? ";
Vector keywords = new Vector();;
SimpleAttributeSet keyword;
public SyntaxTest()
rootElement= this.getDefaultRootElement();
keyword = new SimpleAttributeSet();
StyleConstants.setForeground(keyword, Color.blue);
keywords.add( "abstract" );
keywords.add( "boolean" );
keywords.add( "break" );
keywords.add( "byte" );
keywords.add( "case" );
keywords.add( "catch" );
keywords.add( "char" );
keywords.add( "class" );
keywords.add( "continue" );
keywords.add( "default" );
keywords.add( "do" );
keywords.add( "double" );
keywords.add( "else" );
keywords.add( "extends" );
keywords.add( "false" );
keywords.add( "final" );
keywords.add( "finally" );
keywords.add( "float" );
keywords.add( "for" );
keywords.add( "if" );
keywords.add( "implements" );
keywords.add( "import" );
keywords.add( "instanceof" );
keywords.add( "int" );
keywords.add( "interface" );
keywords.add( "long" );
keywords.add( "native" );
keywords.add( "new" );
keywords.add( "null" );
keywords.add( "package" );
keywords.add( "private" );
keywords.add( "protected" );
keywords.add( "public" );
keywords.add( "return" );
keywords.add( "short" );
keywords.add( "static" );
keywords.add( "super" );
keywords.add( "switch" );
keywords.add( "synchronized" );
keywords.add( "this" );
keywords.add( "throw" );
keywords.add( "throws" );
keywords.add( "true" );
keywords.add( "try" );
keywords.add( "void" );
keywords.add( "volatile" );
keywords.add( "while" );
public void insertString(int offset, String str, AttributeSet a) throws BadLocationException
super.insertString(offset, str, a);
int startOfLine = rootElement.getElement(rootElement.getElementIndex(offset)).getStartOffset();
int endOfLine = rootElement.getElement(rootElement.getElementIndex(offset+str.length())).getEndOffset() -1;
//highlight the changed line
highlightKeyword(this.getText(0,this.getLength()), startOfLine, endOfLine);
public void remove(int offset, int length) throws BadLocationException
super.remove(offset, length);
int startOfLine = rootElement.getElement(rootElement.getElementIndex(offset)).getStartOffset();
int endOfLine = rootElement.getElement(rootElement.getElementIndex(offset+length)).getEndOffset() -1;
//highlight the changed line
highlightKeyword(this.getText(0,this.getLength()), startOfLine, endOfLine);
public void highlightKeyword(String content,int startOffset, int endOffset)
char character;
int tokenEnd;
while (startOffset < endOffset)
tokenEnd = startOffset;
//find next wordSeparator
while(tokenEnd < endOffset)
character = content.charAt(tokenEnd);
if(wordSeparators.indexOf(character) > -1)
break;
else
tokenEnd++;
//check for keyword
String token = content.substring(startOffset,tokenEnd).trim();
if(keywords.contains(token))
this.setCharacterAttributes(startOffset, token.length(), keyword, true);
startOffset = tokenEnd+1;
public static void main(String[] args)
JFrame f = new JFrame();
JTextPane pane = new JTextPane(new SyntaxTest());
JScrollPane scrollPane = new JScrollPane(pane);
f.setContentPane(scrollPane);
f.setSize(600,400);
f.setVisible(true);
} -
Which is the best java editor for Linux ??
in the Win plataform I'm using the JCreator ... and now I'm migrating to the linux plataform...
please tell me the name of the editor you are using if you use Linux... (Red Hat 7.1 here...)you can try SciTE from http://www.scintilla.org - it's simple, fast and good enough. you can work with java, c and many other programming languages. There are some features that don't present in any other editor.
Btw SciTE is only editor, not complete IDE. If you wish a full IDE with projects.. etc you can use Borland's JBuilder -
Hi,
I am trying to make a java editor in java as my final year engineering project. Can anybody give me some help or a link to any tutorial that might help.
The java editor should include a text editor with all the normal operations such as cut,copy, paste, find etc. I also want that the syntax be highlighted. There must be options for compiling and running of programs.
I would be very grateful for the help..........Well, for the text editor you can use the Notepad program that comes with JDK. It has all these options, cut, paste, etc.
Then, every "keyword" should be identified and highlighted.
In the compile button, you should make it save your file and run the command javac in a console....it´s really simple since u already have the Notepad to adapt. -
Hi All,
I am trying to find the name of an editor I seen someone using last semester. The only 2 things I can remember is that when you typed in the name of a class followed by "." you could automatically then choose from a list of available methods from that class. And I think it began with a K, but could be wrong.
Any ideas?Why are you specific about that iDE? Now lot of good IDEs have come up. Search for free JAVA IDE in any search engine gives you numerous results. I am using Eclipse as my IDE (free). which also contains the functionality you have specified.
Good Luck,
Sekar -
Would really like a simple sound editor for my BB Curve
I've been using my BB for a few weeks now and, so far, really like it. The one software that I would REALLY like find is a simple sound editor for my BB. I would like to be able create short audio recordings (using either the voice recorder or other application) and create just a clip of that file (not the entire file) so that I can post them, directly from my BB, to either facebook or my blog. This is very simple to do when audio is transferred to the desktop but I would like to be able to do this from my BB.
Any ideas? Thanks.BassoonMan wrote:
I checked out the PortableApps page and it appears as if that allows me to install some type of data on my BB which can then be run on other computers but not on the BB itself - is that correct?
You are correct. The principle of a PortableApp application is to be put on a USB stick, and then can be used on any desktop or laptop computer without being installed. You have put it on the memory card of your blackberry, it enables you to use it on any computer you plug your Blackberry into.
Concerning a sound editor in Blackberry, I don't know.
The search box on top-right of this page is your true friend, and the public Knowledge Base too: -
Class tab in .java editor (jdev 10.1.3)
Hello,
i am novice in jdeveloper and i am reading the book "jdeveloper 10.1.3 handbook". In a hands-on pratice for create a validator i create a java file in code editor, and after I have to click at the bottom the "Class" tab, but I cannot find "Class" tab,instead is "History" .
Why?
thanksHi,
I'm not sure this is the "jdeveloper 10.1.3 handbook" you are reading.
The Class editor was removed in JDeveloper 10g.
In this release, you can enter your variable in your Java code, and then select "Generate Assessors...' in the contextual menu.
You can also install the "Simple Java Bean Editor" extension
See on "Oracle JDeveloper 10g 10.1.3 - Extensions Exchange"
URL: http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/index.html
If you have any problem with this change, please let me know the exact document/page/step/... and I'll give you detailed instructions on how to perform the equivalent in JDeveloper 10.1.3
Regards,
Didier. -
JPanel which uses reflection to create a simple property editor
Hi everyone,
Here's what I'd like: a custom JPanel, let's call it DesiredJPanel, which can be passed an object as an argument, and which then detects all the public getters and setters on that object, and then creates a simple property editor, with default behavior for numbers, booleans, Strings, etc. It might be used like this:
JDialog dialog = new JDialog(new DesiredJPanel(someObjectWithSettersAndGetters)));
dialog.setVisible(true);
Then we'd get a dialog populated with the current values of all relevant properties. The panel could have a button bar, with an ok button. When you press it, all the properties of someObjectWithSettersAndGetters are set according to what the user has entered in the fields of the panel.
This seems like a pervasive, standard use case. It also seems like javabeans is intended for this. E.g. quoting wikipedia: "JavaBeans are reusable software components for Java that can be manipulated visually in a builder tool." Moreover, there is the java.beans.PropertyEditor interface.
And yet I can't find anything that seems to do this, so I end up writing the same boilerplate style code over and over. I found some commercial thing (this is for an open source project), and netbeans does what I'm after but it's netbeans. I want something that can be used in any swing app.
Apologies if I've overlooked something obvious or posted this to the wrong forum (if either, please let me know!).
All best and happy new year!
- JeffNot exactly what you asked for, but reasonably close. You can use my [Bean Table Model|http://www.camick.com/java/blog.html?name=bean-table-model] to create a JTable which will display all the properties in a single row of a table. The appropriate renderer/editor is used for each property.
Play with the commented out code in JButtonTableModel class to see what you get for your particular bean. -
How to pass a HTTP request from a simple java class
Is it possible to pass an HTTP request from a simple java class.if yes how?
Is it possible to pass an HTTP request from a simple
java class.if yes how?If you're talking about creating a HttpRequest object and passing it to a servlet, that would be a red flag to me that your design is flawed. You shouldn't have to do that - the application server (Tomcat, Weblogic, etc) should be the only thing that has to worry about creating that kind of object and passing it to you.
Maybe you are looking for
-
HP Laserjet P1102W Printer Wireless Setup Issues on a Mac
Numerous Problems trying to setup a wireless network on HP1102W laserjet printer on a mac and problems with printer going into sleep mode and then trying to wake the printer to print. Nothing seems to work.
-
How to make 'Overall Limit' field as display only in ME22/ME22N
Hi, I want to make the 'Overall Limit' field as display only in transation ME22/ME22N (only for Service Items). I can make the field display only for ALL Service Items by going to: SPRO u2013 IMG - Material Management - External Services Management -
-
Why do I have to update Keynote,Numbers,and Pages on a daily basis?
For the past week I've had to update Keynote, Numbers, and Pages on a daily basis?If I update the apps today, tomorrow I will be asked to update them again.Something is wrong with picture. Is anyone else having this issue?
-
ITunes 8 crashing my computer.
When I access the "TV shows" section of the iTunes store, my computer locks up. I can't even force quit. My cursor arrow works, but nothing happens. I have to restart my machine each time I access "TV Shows".
-
I'm trying to synce my iPhone 4s but it isn't completing the last step (step 7).
I'm trying to synce my iPhone 4s but it isn't completing the last step (step 7). It says "waiting for items to copy." The stripped bar just continues to move to the right. Even if I try to cancel it stalls there too. I have to eject the iPhone from t