1) Name four properties of an OpenFileDialog that we often set prior to using ShowDialog() to
open that screen
i) ValidateNames : Gets or sets a value indicating whether the dialog box accepts only valid
Win32 file names.(Inherited fromFileDialog.)
ii) RestoreDirectory : Gets or sets a value indicating whether the dialog box restores the directory
to the previously selected directory before closing
iii) CheckFileExists : Gets or sets a value indicating whether the dialog box displays a warning if
the user specifies a file name that does not exist.
iv) ShowReadOnly : Gets or sets a value indicating whether the dialog box contains a read-only
check box.
2) XML stands for \' Extensible Markup Language \'.
3) HTML Stands for \' HyperText Markup Language \'.
4) what would you set the filter to for an OpenFileDialog if you wanted the user to only be able
to select the text file
Answer) FileDialog.FilterIndex
FilterIndex property represents the index of the filter currently selected in the file dialog box
5)What two things do we put into an xml file?
Answer)
6) what is the name of the class we use if we want to output to a text file one line at a time
Answer) StreamReader class
ReadLine method of the StreamReader class. Each text line is stored into the string line and
displayed on the screen.
8) Program:
import java.io.*;
class Arithmetic Exception
{
public static void main(String args[])throws IOException
{
try
{
int a=1,b=0,c;
c=a/b;
}
catch(Arithmetic Exception ae)
{
System.out.println( ae );
}
}
}
Solution
1) Name four properties of an OpenFileDialog that we often set prior to using ShowDialog() to
open that screen
i) ValidateNames : Gets or sets a value indicating whether the dialog box accepts only valid
Win32 file names.(Inherited fromFileDialog.)
ii) RestoreDirectory : Gets or sets a value indicating whether the dialog box restores the directory
to the previously selected directory before closing
iii) CheckFileExists : Gets or sets a value indicating whether the dialog box displays a warning if
the user specifies a file name that does not exist.
iv) ShowReadOnly : Gets or sets a value indicating whether the dialog box contains a read-only
check box.
2) XML stands for \' Extensible Markup Language \'.
3) HTML Stands for \' HyperText Markup Language \'.
4) what would you set the filter to for an OpenFileDialog if you wanted the user to only be able
to select the text file
Answer) FileDialog.FilterIndex
FilterIndex property represents the index of the filter currently selected in the file dialog box
5)What two things do we put into an xml file?
Answer)
6) what is the name of the class we use if we want to output to a text file one line at a time
Answer) StreamReader class
ReadLine method of the StreamReader class. Each text line is stored into the string line and
displayed on the screen.
8) Program:
import java.io.*;
class Arithmetic Exception
{
public static void main(String args[])throws IOException
{
try
{
int a=1,b=0,c;
c=a/b;
}
catch(Arit.
1) Name four properties of an OpenFileDialog that we often set prior.pdf
1. 1) Name four properties of an OpenFileDialog that we often set prior to using ShowDialog() to
open that screen
i) ValidateNames : Gets or sets a value indicating whether the dialog box accepts only valid
Win32 file names.(Inherited fromFileDialog.)
ii) RestoreDirectory : Gets or sets a value indicating whether the dialog box restores the directory
to the previously selected directory before closing
iii) CheckFileExists : Gets or sets a value indicating whether the dialog box displays a warning if
the user specifies a file name that does not exist.
iv) ShowReadOnly : Gets or sets a value indicating whether the dialog box contains a read-only
check box.
2) XML stands for ' Extensible Markup Language '.
3) HTML Stands for ' HyperText Markup Language '.
4) what would you set the filter to for an OpenFileDialog if you wanted the user to only be able
to select the text file
Answer) FileDialog.FilterIndex
FilterIndex property represents the index of the filter currently selected in the file dialog box
5)What two things do we put into an xml file?
Answer)
6) what is the name of the class we use if we want to output to a text file one line at a time
Answer) StreamReader class
ReadLine method of the StreamReader class. Each text line is stored into the string line and
displayed on the screen.
8) Program:
import java.io.*;
class Arithmetic Exception
{
public static void main(String args[])throws IOException
{
try
{
int a=1,b=0,c;
c=a/b;
}
catch(Arithmetic Exception ae)
{
2. System.out.println( ae );
}
}
}
Solution
1) Name four properties of an OpenFileDialog that we often set prior to using ShowDialog() to
open that screen
i) ValidateNames : Gets or sets a value indicating whether the dialog box accepts only valid
Win32 file names.(Inherited fromFileDialog.)
ii) RestoreDirectory : Gets or sets a value indicating whether the dialog box restores the directory
to the previously selected directory before closing
iii) CheckFileExists : Gets or sets a value indicating whether the dialog box displays a warning if
the user specifies a file name that does not exist.
iv) ShowReadOnly : Gets or sets a value indicating whether the dialog box contains a read-only
check box.
2) XML stands for ' Extensible Markup Language '.
3) HTML Stands for ' HyperText Markup Language '.
4) what would you set the filter to for an OpenFileDialog if you wanted the user to only be able
to select the text file
Answer) FileDialog.FilterIndex
FilterIndex property represents the index of the filter currently selected in the file dialog box
5)What two things do we put into an xml file?
Answer)
6) what is the name of the class we use if we want to output to a text file one line at a time
Answer) StreamReader class
ReadLine method of the StreamReader class. Each text line is stored into the string line and
displayed on the screen.
8) Program:
import java.io.*;
class Arithmetic Exception
{
public static void main(String args[])throws IOException
{
try