готовые кнопки

This commit is contained in:
Данил Лопатин 2024-02-19 09:09:39 +03:00
parent 4a8486316f
commit 21cf202793
6 changed files with 19 additions and 21 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
# ---> VisualStudioCode
*.class
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json

View File

@ -1,6 +1,3 @@
import java.awt.*;
import java.net.URL;
import javax.swing.*;
public class FormWarmlyLocomotive extends JFrame {
@ -19,43 +16,43 @@ public class FormWarmlyLocomotive extends JFrame {
//createButton
JButton createButton = new JButton("Создать");
createButton.setBounds(20, 420, 90, 25);
createButton.setBounds(10, 420, 90, 30);
pictureBox.add(createButton);
//upButton
//ImageIcon img1 = new ImageIcon("Resources/UpArrow.png");
JButton upButton = new JButton();
//upButton.setIcon(img1);
//upButton.setPreferredSize(new Dimension(30, 30));
upButton.setBounds(810, 385, 30, 30);
ImageIcon imgUp = new ImageIcon("Resources\\UpArrow.png");
upButton.setIcon(imgUp);
upButton.setSize(30,30);
upButton.setLocation(810,385);
pictureBox.add(upButton);
//downButton
//ImageIcon img1 = new ImageIcon("Resources/UpArrow.png");
JButton downButton = new JButton();
//upButton.setIcon(img1);
//upButton.setPreferredSize(new Dimension(30, 30));
downButton.setBounds(810, 420, 30, 30);
ImageIcon imgDn = new ImageIcon("Resources\\DownArrow.png");
downButton.setIcon(imgDn);
downButton.setSize(30 ,30);
downButton.setLocation(810, 420);
pictureBox.add(downButton);
//rightButton
//ImageIcon img1 = new ImageIcon("Resources/UpArrow.png");
JButton rightButton = new JButton();
//upButton.setIcon(img1);
//upButton.setPreferredSize(new Dimension(30, 30));
rightButton.setBounds(845, 420, 30, 30);
ImageIcon imgRt = new ImageIcon("Resources\\RightArrow.png");
rightButton.setIcon(imgRt);
rightButton.setSize(30, 30);
rightButton.setLocation(845, 420);
pictureBox.add(rightButton);
//downButton
//ImageIcon img1 = new ImageIcon("Resources/UpArrow.png");
JButton leftButton = new JButton();
//upButton.setIcon(img1);
//upButton.setPreferredSize(new Dimension(30, 30));
leftButton.setBounds(775, 420, 30, 30);
ImageIcon imgLt = new ImageIcon("Resources\\LeftArrow.png");
leftButton.setIcon(imgLt);
leftButton.setSize(30, 30);
leftButton.setLocation(775, 420);
pictureBox.add(leftButton);
add(pictureBox);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 B

After

Width:  |  Height:  |  Size: 989 B