BF [2275464] - Selected printer is not saved in preferences

https://sourceforge.net/tracker/index.php?func=detail&aid=2275464&group_id=176962&atid=879332
This commit is contained in:
Carlos Ruiz 2009-08-14 01:37:31 +00:00
parent a53e0ffa42
commit 70c37297cc
1 changed files with 8 additions and 0 deletions

View File

@ -174,8 +174,16 @@ public class CPrinter extends CComboBox implements ActionListener
* Refresh printer list
*/
public void refresh() {
String current = (String) getSelectedItem();
removeAllItems();
setModel(new DefaultComboBoxModel(getPrinterNames()));
if (current != null) {
for (int i = 0; i < getItemCount(); i++) {
String item = (String) getItemAt(i);
if (item.equals(current))
setSelectedIndex(i);
}
}
}
} // CPrinter