Fixed focus

This commit is contained in:
2015-04-08 12:55:07 +02:00
parent 0c9d41585c
commit 3d0324e80b
2 changed files with 11 additions and 3 deletions
+5
View File
@@ -42,6 +42,7 @@ public class ControlPanel extends JPanel
simulatorPanel.add(simulatorLabel);
JButton playButton = new JButton("Play");
playButton.setFocusable(false);
playButton.setFont(new Font("Segoe UI", Font.PLAIN, 20));
playButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
@@ -52,6 +53,7 @@ public class ControlPanel extends JPanel
simulatorPanel.add(playButton);
JButton pauseButton = new JButton("Pause");
pauseButton.setFocusable(false);
pauseButton.setFont(new Font("Segoe UI", Font.PLAIN, 20));
pauseButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
@@ -62,6 +64,7 @@ public class ControlPanel extends JPanel
simulatorPanel.add(pauseButton);
JButton stopButton = new JButton("Stop");
stopButton.setFocusable(false);
stopButton.setFont(new Font("Segoe UI", Font.PLAIN, 20));
stopButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
@@ -84,6 +87,7 @@ public class ControlPanel extends JPanel
timePanel.add(timeLabel);
JButton dateButton = new JButton("Pick Date");
dateButton.setFocusable(false);
dateButton.setFont(new Font("Segoe UI", Font.PLAIN, 20));
dateButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
@@ -106,6 +110,7 @@ public class ControlPanel extends JPanel
peoplePanel.add(peopleLabel);
JButton peopleButton = new JButton("Set People");
peopleButton.setFocusable(false);
peopleButton.setFont(new Font("Segoe UI", Font.PLAIN, 20));
peopleButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
+6 -3
View File
@@ -98,6 +98,7 @@ public class PropertiesPanel extends JPanel
// BUTTONS ROW 1
JPanel row1ButtonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
JButton deleteButton = new JButton("Delete");
deleteButton.setFocusable(false);
deleteButton.setFont(new Font("Segoe UI", Font.PLAIN, 20));
deleteButton.addActionListener(new ActionListener()
{
@@ -112,6 +113,7 @@ public class PropertiesPanel extends JPanel
}
});
JButton areaButton = new JButton("Area");
areaButton.setFocusable(false);
areaButton.setFont(new Font("Segoe UI", Font.PLAIN, 20));
areaButton.addActionListener(new ActionListener()
{
@@ -331,7 +333,8 @@ public class PropertiesPanel extends JPanel
{
locationXField.setBackground(Color.WHITE);
double xpos = Double.parseDouble(locationXField.getText());
selectedObject.setPosition(new Point2D.Double(xpos, selectedObject.getPosition().getY()));
selectedObject.setPosition(new Point2D.Double(xpos, selectedObject.getPosition().getY()), true);
update();
p.update();
}
catch (NumberFormatException nfe)
@@ -370,8 +373,8 @@ public class PropertiesPanel extends JPanel
{
locationYField.setBackground(Color.WHITE);
double ypos = Double.parseDouble(locationYField.getText());
selectedObject.setPosition(new Point2D.Double(selectedObject.getPosition().getX(), ypos));
;
selectedObject.setPosition(new Point2D.Double(selectedObject.getPosition().getX(), ypos), true);
update();
p.update();
}
catch (NumberFormatException nfe)