-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOngletImage.java
More file actions
47 lines (40 loc) · 1.45 KB
/
OngletImage.java
File metadata and controls
47 lines (40 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Insets;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.event.UndoableEditEvent;
import javax.swing.event.UndoableEditListener;
import javax.swing.text.BadLocationException;
import javax.swing.text.html.HTML;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.StyleSheet;
import javax.swing.undo.UndoManager;
public class OngletImage extends Onglet // implements UndoableEditListener
{
private static final long serialVersionUID = 1L;
private ImageIcon image;
public OngletImage(Fichier fichier) {
super(fichier);
setLayout(new BorderLayout());
JPanel jp = new JPanel(new BorderLayout());
jp.setBackground(Color.DARK_GRAY);
image = new ImageIcon(((FichierImage) this.fichier).getChemin());
JLabel label1 = new JLabel(this.fichier.getNomFichier() + " (" + image.getIconWidth() + "x" + image.getIconHeight() + ")", JLabel.CENTER);
label1.setForeground(Color.WHITE);
jp.add(label1, BorderLayout.NORTH);
JLabel label2 = new JLabel(null, image, JLabel.CENTER);
jp.add(label2, BorderLayout.SOUTH);
JScrollPane sclScroll = new JScrollPane(jp);
add(sclScroll);
}
}