-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Committing images that weren't in the last commit
- Loading branch information
Showing
6 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package view; | ||
|
||
import java.awt.Color; | ||
import java.awt.Dimension; | ||
import java.awt.Font; | ||
import java.awt.Graphics; | ||
import java.awt.Graphics2D; | ||
import java.awt.RenderingHints; | ||
import java.awt.image.BufferedImage; | ||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import javax.imageio.ImageIO; | ||
import javax.swing.JButton; | ||
|
||
public class ScrollButton extends JButton{ | ||
|
||
private static final long serialVersionUID = 1L; | ||
BufferedImage image; | ||
String text; | ||
|
||
public ScrollButton(String text) { | ||
this.text = text; | ||
try { | ||
image = ImageIO.read(new File("src/images/scrollbutton.jpg")); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
@Override | ||
protected void paintComponent(Graphics g) { | ||
super.paintComponent(g); | ||
Graphics2D g2d= (Graphics2D) g; | ||
g.drawImage(image, 0, 0, null); | ||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); | ||
g2d.setColor(Color.BLACK); | ||
g2d.setFont(new Font("Elephant", Font.BOLD, 15)); | ||
g2d.drawString(text, 12, 30); | ||
} | ||
|
||
@Override | ||
public Dimension getPreferredSize() { | ||
return new Dimension(image.getWidth(), image.getHeight()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package view; | ||
|
||
import java.awt.Graphics; | ||
import java.awt.Graphics2D; | ||
import java.awt.LayoutManager; | ||
import java.awt.image.BufferedImage; | ||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import javax.imageio.ImageIO; | ||
import javax.swing.JPanel; | ||
|
||
public class TransactionPanel extends JPanel { | ||
|
||
private static final long serialVersionUID = 1L; | ||
BufferedImage background = null; | ||
|
||
|
||
TransactionPanel(LayoutManager lm) { | ||
super(lm); | ||
background = loadImage("Merchant-real.png"); | ||
} | ||
|
||
@Override | ||
public void paintComponent(Graphics g) { | ||
super.paintComponent(g); | ||
Graphics2D g2d = (Graphics2D) g; | ||
g2d.drawImage(background, 0, 0, null); | ||
|
||
} | ||
|
||
public BufferedImage loadImage(String fileName) { | ||
|
||
BufferedImage image = null; | ||
|
||
try { | ||
image = ImageIO.read(new File("src/images/" + fileName)); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
return image; | ||
} | ||
|
||
} |