hi,
i just want to ask how do i prevent JComboBox in the JFileChooser from, going up to the next folder, but i can go to the subfolder of the defaulth path...
example:
my default path is C:\Temp\data, i can go to the subfolders of C:\Temp\data, but i cannot go upward like C:\Temp or C:\, in this case if the user goes up, the JComboBox will force to set the defaulth path.
here are some of the codes...
public void load()
{
��.
cJComboBox.addActionListener( this );
��..
}
public void actionPerformed(ActionEvent pEvent)
{
Object mSourceObj = pEvent.getSource();
if (mSourceObj.equals(cJComboBox))
{
comboboxChanged();
}
}
private void comboboxChanged()
{
String mlen = cJComboBox.getSelectedItem().toString();
if (currentPath.startsWith(defaultPath))
{
.............
}
else
{
setCurrentDirectory(new File(defaulthPath)); -> force the combobox to default path...
.............
}
}
i just want to ask how do i prevent JComboBox in the JFileChooser from, going up to the next folder, but i can go to the subfolder of the defaulth path...
example:
my default path is C:\Temp\data, i can go to the subfolders of C:\Temp\data, but i cannot go upward like C:\Temp or C:\, in this case if the user goes up, the JComboBox will force to set the defaulth path.
here are some of the codes...
public void load()
{
��.
cJComboBox.addActionListener( this );
��..
}
public void actionPerformed(ActionEvent pEvent)
{
Object mSourceObj = pEvent.getSource();
if (mSourceObj.equals(cJComboBox))
{
comboboxChanged();
}
}
private void comboboxChanged()
{
String mlen = cJComboBox.getSelectedItem().toString();
if (currentPath.startsWith(defaultPath))
{
.............
}
else
{
setCurrentDirectory(new File(defaulthPath)); -> force the combobox to default path...
.............
}
}