This commit is contained in:
@@ -104,17 +104,17 @@ public class CameraApp extends JFrame {
|
|||||||
gbc.gridwidth = 1;
|
gbc.gridwidth = 1;
|
||||||
gbc.gridx = 0; gbc.gridy = 2;
|
gbc.gridx = 0; gbc.gridy = 2;
|
||||||
JButton startButton = new JButton("Start Camera");
|
JButton startButton = new JButton("Start Camera");
|
||||||
startButton.addActionListener(_ -> startCamera());
|
startButton.addActionListener(e -> startCamera());
|
||||||
controlsPanel.add(startButton, gbc);
|
controlsPanel.add(startButton, gbc);
|
||||||
|
|
||||||
gbc.gridx = 1;
|
gbc.gridx = 1;
|
||||||
JButton stopButton = new JButton("Stop Camera");
|
JButton stopButton = new JButton("Stop Camera");
|
||||||
stopButton.addActionListener(_ -> stopCamera());
|
stopButton.addActionListener(e -> stopCamera());
|
||||||
controlsPanel.add(stopButton, gbc);
|
controlsPanel.add(stopButton, gbc);
|
||||||
|
|
||||||
gbc.gridx = 0; gbc.gridy = 3; gbc.gridwidth = 2;
|
gbc.gridx = 0; gbc.gridy = 3; gbc.gridwidth = 2;
|
||||||
JButton snapshotButton = new JButton("Take Snapshot");
|
JButton snapshotButton = new JButton("Take Snapshot");
|
||||||
snapshotButton.addActionListener(_ -> takeSnapshot());
|
snapshotButton.addActionListener(e -> takeSnapshot());
|
||||||
controlsPanel.add(snapshotButton, gbc);
|
controlsPanel.add(snapshotButton, gbc);
|
||||||
|
|
||||||
mainPanel.add(controlsPanel, BorderLayout.SOUTH);
|
mainPanel.add(controlsPanel, BorderLayout.SOUTH);
|
||||||
@@ -126,7 +126,7 @@ public class CameraApp extends JFrame {
|
|||||||
contentPane.add(statusLabel, BorderLayout.SOUTH);
|
contentPane.add(statusLabel, BorderLayout.SOUTH);
|
||||||
|
|
||||||
// Set up timer
|
// Set up timer
|
||||||
timer = new Timer(30, _ -> updateFrame());
|
timer = new Timer(30, e -> updateFrame());
|
||||||
|
|
||||||
// Detect cameras after UI is ready
|
// Detect cameras after UI is ready
|
||||||
SwingUtilities.invokeLater(this::detectCameras);
|
SwingUtilities.invokeLater(this::detectCameras);
|
||||||
@@ -624,7 +624,7 @@ class DownloadProgressBar extends JDialog {
|
|||||||
panel.add(progress, BorderLayout.CENTER);
|
panel.add(progress, BorderLayout.CENTER);
|
||||||
|
|
||||||
JButton cancelButton = new JButton("Cancel");
|
JButton cancelButton = new JButton("Cancel");
|
||||||
cancelButton.addActionListener(_ -> setVisible(false));
|
cancelButton.addActionListener(e -> setVisible(false));
|
||||||
panel.add(cancelButton, BorderLayout.SOUTH);
|
panel.add(cancelButton, BorderLayout.SOUTH);
|
||||||
|
|
||||||
add(panel);
|
add(panel);
|
||||||
|
|||||||
Reference in New Issue
Block a user