SerialPortChooser.execute(...) added parent Component parameter
parent
a14c4bcc45
commit
85c05155bd
|
@ -1,6 +1,7 @@
|
|||
package org.hwo.ui.dialog;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Component;
|
||||
import java.awt.FlowLayout;
|
||||
|
||||
import javax.swing.JButton;
|
||||
|
@ -33,12 +34,19 @@ public class SerialPortChooser extends JDialog {
|
|||
return execute(null);
|
||||
}
|
||||
public static NewSerialPort execute(String selectedPortName)
|
||||
{
|
||||
return execute(null, selectedPortName);
|
||||
}
|
||||
public static NewSerialPort execute(Component parent,String selectedPortName)
|
||||
{
|
||||
SerialPortChooser spc = new SerialPortChooser();
|
||||
|
||||
if (selectedPortName != null)
|
||||
spc.setSelectedSerialPort(selectedPortName);
|
||||
|
||||
if (parent != null)
|
||||
spc.setLocationRelativeTo(parent);
|
||||
|
||||
spc.setVisible(true);
|
||||
|
||||
return spc.getSelectedSerialPort();
|
||||
|
|
Loading…
Reference in New Issue