Oh my God, I dont know how to make that short because I guess this is the shortest it can be. All the codes here are necessary to run the program and address my problem.
This program is a notepad... The problem here is that I am trying to make the program capable of using undo but the problem is it cannot tell weather an action happened. [ July 11, 2008: Message edited by: eLL Pascual ]
Im sorry for not explaining my problem very clearly... In your nokia cellphone, there are corresponding letters in every number right?
That's how the number 23 got the letters ad ae af etc... the program will print all possible letter combinations.
These are the letters: number 1: special characters number 2: abc number 3: def number 4: ghi number 5: jkl number 6: mno number 7: pqrs number 8: tuv number 9: wxyz number 0: space
I haven't started yet because I dont know how. Actually I already tried it. I used nesting for loop and if-else but the problem is my program is not printing anything correctly. So my problem is merely everything.
I really want to make a program that is accepting integer values and I want that program to print all possible letter combinations assigned to each number or maybe not all. Just like when you type 23, the program should print "ad ae af bd be bf cd ce cf".
I already have a complete and working code of undo and undoAction but the problem is it is so confusing and I can't understand the importance of each code. Maybe you can give me the steps on how to do it and I will just compare it to the codes I have...
public void mousePressed(MouseEvent me) { System.out.print("Mouse Right-Clicked!");//Test if the mousePressed is working if(me.getModifiers() != 0){ popup.show(this, me.getX(), me.getY());
} }
public void mouseClicked(MouseEvent e){} public void mouseReleased(MouseEvent e){} public void mouseEntered(MouseEvent e){} public void mouseExited(MouseEvent e){}
In my program, I created a menu bar and a toolbar, meaning, aside from the menu bar I have buttons as a (standard)toolbar also. But the problem is when I click the menu items, the program is calling the message box that is supposedly a message box that should appear when I click a button from the toolbar, and when I click a button from the toolbar, it is throwing
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.JButton cannot be cast to javax.swing.JMenuItem
Details? Ahhmmm. Actually I decided to stop using Scanner because I saw a demo using FileInputStream and FileOutputStream working very well. I just followed how the programmer used the codes and found myself dealing with the same problem I had when I was still using Scanner. FileInputStream is reading only one line of the text area, it is ignoring the succeeding lines. While the FileOutputStream in the demo is writing texts in a text file the way I typed the texts in the textArea. But in my own program, it is writing the texts in one straight line only even though I had several lines. Look at my example.
In my textArea:
Cedric Diggory Harry Potter
In the text file:
[] - supposedly a square
Cedric[]Diggory[]Harry Potter
But the demo is working well. I dont know what is the problem. Actually the only difference between my codes and the programmer's code are names.
Since Campbell told me that Scanner is very easy to use, I guess I will show you my code and tell me what is wrong. The problems with my Scanner is the same with the problems I mentioned above.
What does it mean when you have this in your folder?
notepad$1.class notepad.class
I used to ignore the first one but I saw a fully working jar file with all ten ...$10.class inside. So now I am wondering if it is necessary to include all of them in my jar file 'coz until now I haven't made my works jarred and working. I have them jarred but working no.There is always an error. Thanks!