Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
I am going to save the drawing into an arraylist and save that arraylist as a file. my coding under savefile() is bellow. when i use the button from paintpanel it is working fine and i can able to save it... but i should use the menu and get the event from menu. i donno how to get the menu even from PMenuBar.java. Please give me an idea how can i call this save method from PMenuBar. my savefile() in DrawareaPanel is bellow.
public void savefile() { JFileChooser filecho = new JFileChooser("."); filecho.setDialogTitle("Save File As"); int action = fichooser.showSaveDialog(this);
if (action != JFileChooser.APPROVE_OPTION) { // When canceled. return; }
File file = filecho.getSelectedFile();
if (file.exists()) { action = JOptionPane.showConfirmDialog(this,"File exists, overwrite the file?"); if (action != JOptionPane.YES_OPTION) return; }
Thanks for your help. If i have another menu item call "save" and i have one class savefile() in DrawareaPanel then how can i call savefile() from PMenuBar. Please give me an idea. Thanks in advance. My programes are below.
Hi i am a basic leaner in java. Anyone please help me how can i change the colour when i choose the coloritem from menubar. May be my OOPs comcept is wrong. But i should keep 4 different programs. Please tell me how i have to use the OOP concept to keep 4 programs and do this work. My 4 programes are bellow. Advance thanks for your help.
EDIT by mw: Added Code Tags to original poster's indentation. [ January 16, 2006: Message edited by: marc weber ]
How to save a paragraph (multi line) in a string.. then im going to display that string as a showMessageDialog. My problem is i can save in a string as a single line or use the special symbol like \n or \t. if i do so i have to type every thing in a line.. how can i type is like a paragraph and then show the message.
Any one could please help me to give idea "how to draw a rectangle using mouse in Jpanel" and it should allow to draw more than one rectangle or other shapes.. if anyone have sample code please give it and help me... thanks in advance.
Any one could please help me to give idea "how to draw a rectangle using mouse in Jpanel" and it should allow to draw more than one rectangle or other shapes.. if anyone have sample code please give it and help me... thanks in advance.