How to implement an auto-complete for a text editor written in java?
I'm trying to create a text editor like program for coding in mips assembly using java , the point i got mixed up alittle was the part i was trying to provide a Control-Space feature like that of eclipse's.For example when the user enters add $s1 , then presses ctrl+Space , i would replace this string: "add $s1 , $s2 , $s3" with what he has typed! ( that's an example .. i know add can be of immediate type instructions :D ), I'm using a hashmap to bind key strokes to what will actually happen in my JTextPane , sth like : InputMap inputMap = textPane.getInputMap(); KeyStroke key = KeyStroke