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

Subitha Sangar

Greenhorn
+ Follow
since Jan 10, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Subitha Sangar

Hi, Michael Dunn. Thank you so much for your help. i did the same way and it is working fine.
16 years ago
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;
}


try {
ObjectOutputStream out =
new ObjectOutputStream(new FileOutputStream(file));
//out.writeObject(getBackground());
out.writeObject(arrayline);
out.close();
}
catch (IOException e) {
JOptionPane.showMessageDialog(this,
"Error :\t" + e.getMessage());
}
}
16 years ago
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.

16 years ago
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 ]
16 years ago
Thanks for your idea Jeff.
16 years ago
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.

String details = " fffffffffffffffffffffffffffffffff ffffffffffffffff
ffffffffffffffff fffffffff fffffffffffffff ffffffff"

JOptionPane.showMessageDialog(null,ab,"deatails",JOptionPane.INFORMATION_MESSAGE);
16 years ago
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.
16 years ago
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.
16 years ago