Commit 12ffa7ba authored by pfreon's avatar pfreon
Browse files

Addition of the CLIMPROD icon in the "About" file.

Addition of the CLIMPROD icon in the Copyright file of the sub-menu "About" in the "Help" menu.
Improvement of the icon
parent 455f37d2
......@@ -7,21 +7,21 @@ import javax.swing.*;
import javax.swing.border.*;
public class CadreMain_AboutBox extends JDialog implements ActionListener {
JPanel panel1 = new JPanel();
JPanel jPanAbout = new JPanel();
JPanel jPanCmd = new JPanel();
// JPanel jPanImage = new JPanel();
JPanel jPanImage = new JPanel();
JPanel jPanText = new JPanel();
JButton cmdOK = new JButton();
// JLabel imageIcone = new JLabel();
//ImageIcon imageIcon;
JLabel imageIcone = new JLabel();
ImageIcon imageIcon;
JTextArea jTextAreaCopyRight = new JTextArea();
BorderLayout borderLayout1 = new BorderLayout();
//BorderLayout borderLayout2 = new BorderLayout();
BorderLayout borderLayout2 = new BorderLayout();
FlowLayout flowLayout1 = new FlowLayout();
FlowLayout flowLayout2 = new FlowLayout();
GridLayout gridLayout1 = new GridLayout();
......@@ -38,22 +38,43 @@ public class CadreMain_AboutBox extends JDialog implements ActionListener {
catch(Exception e) {
e.printStackTrace();
}
// imageIcone.setIcon(imageIcon);
imageIcone.setIcon(imageIcon);
pack();
}
private void jbInit() throws Exception {
//imageIcon = new ImageIcon(getClass().getResource("Climprod.jpg"));
imageIcon = new ImageIcon(getClass().getResource("resources/images/Climprod.jpg"));
this.setTitle("About");
setResizable(false);
jPanAbout.setLayout(borderLayout1);
panel1.setLayout(borderLayout1);
jPanAbout.setLayout(borderLayout2);
jPanCmd.setLayout(flowLayout1);
//jPanImage.setLayout(flowLayout1);
// jPanImage.setBorder(new EmptyBorder(10, 10, 10, 10));
// gridLayout1.setRows(4);
// gridLayout1.setColumns(1);
jPanImage.setLayout(flowLayout1);
jPanImage.setBorder(new EmptyBorder(10, 10, 10, 10));
jPanText.add(jTextAreaCopyRight, null);
gridLayout1.setRows(4);
gridLayout1.setColumns(1);
jPanText.setLayout(gridLayout1);
jPanText.setBorder(new EmptyBorder(10, 60, 10, 10));
cmdOK.setText("Ok");
cmdOK.addActionListener(this);
int condition = JComponent.WHEN_IN_FOCUSED_WINDOW;
KeyStroke keyStrokep = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
InputMap inputMapp = cmdOK.getInputMap(condition);
ActionMap actionMapp = cmdOK.getActionMap();
inputMapp.put(keyStrokep, keyStrokep.toString());
actionMapp.put(keyStrokep.toString(), new AbstractAction() {
@Override
public void actionPerformed(ActionEvent arg0) {
cmdOK.doClick();
}
});
jTextAreaCopyRight.setPreferredSize(new Dimension(450, 600));
jTextAreaCopyRight.setWrapStyleWord(true);
jTextAreaCopyRight.setRows(20);
jTextAreaCopyRight.setLineWrap(true);
jTextAreaCopyRight.setDoubleBuffered(true);
jTextAreaCopyRight.setText(
" [©FAO-IRD 2003]\n"+
"COPYRIGHT: All rights reserved. Reproduction and dissemination " +
......@@ -87,52 +108,25 @@ public class CadreMain_AboutBox extends JDialog implements ActionListener {
"or guarantee the validity of the information provided. The sole purpose " +
"of links to non-FAO and non-IRD sites is to indicate further information " +
"available on related topics.");
jTextAreaCopyRight.setLineWrap(true);
jTextAreaCopyRight.setWrapStyleWord(true);
jTextAreaCopyRight.setPreferredSize(new Dimension(500, 600)); // Avant 400, 500. Modif 2020.
jTextAreaCopyRight.setAutoscrolls(false);
jTextAreaCopyRight.setEditable(false);
jTextAreaCopyRight.setMargin(new Insets(5, 5, 5, 5));
jTextAreaCopyRight.setFont(new java.awt.Font("Serif", 0, 14)); // Fenetre Help ->About du menu principal. Avant 0, 11. Modif 2020.
jTextAreaCopyRight.setFont(new java.awt.Font("Serif", 0, 13)); // Fenetre Help ->About du menu principal. Avant 0, 11. Modif 2020.
jPanText.setLayout(flowLayout1);
jPanText.setBorder(new EmptyBorder(10, 10, 10, 10));
jPanText.add(jTextAreaCopyRight, null);
//jPanImage.add(imageIcone, null);
cmdOK.setText("Ok");
int condition = JComponent.WHEN_IN_FOCUSED_WINDOW;
KeyStroke keyStrokep = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
InputMap inputMapp = cmdOK.getInputMap(condition);
ActionMap actionMapp = cmdOK.getActionMap();
inputMapp.put(keyStrokep, keyStrokep.toString());
actionMapp.put(keyStrokep.toString(), new AbstractAction() {
@Override
public void actionPerformed(ActionEvent arg0) {
cmdOK.doClick();
}
});
cmdOK.addActionListener(this);
jPanCmd.add(cmdOK, null);
// jPanImage.add(imageIcone, null);
// jPanAbout.add(jPanImage, BorderLayout.WEST);
//borderLayout2.setHgap(5);
// borderLayout2.setVgap(5);
jPanImage.add(imageIcone, null);
jPanAbout.add(jPanImage, BorderLayout.WEST);
jPanImage.add(jTextAreaCopyRight, null);
this.getContentPane().add(panel1, null);
jPanAbout.add(jPanText, BorderLayout.CENTER);
jPanAbout.add(jPanCmd, BorderLayout.SOUTH);
panel1.add(jPanCmd, BorderLayout.CENTER);
jPanCmd.add(cmdOK, null);
panel1.add(jPanAbout, BorderLayout.NORTH);
borderLayout2.setHgap(5);
borderLayout2.setVgap(5);
this.getContentPane().add(jPanAbout, null);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment