Forum » Programiranje » [Java] spemeniti velikost slike
[Java] spemeniti velikost slike
dreamtheater ::
Pozdravljeni!
Zanima me kako bi spremenil velikosti slik kart ? (original velikost je 200x250)
Že v naprej hvala vsem za pomoč!
(2 stavka kode sta bila odstranjena zaradi neomogočenosti objave(HTML))
Koda:
(package testing;
import java.awt.*;
import javax.swing.*;
public class Testing extends javax.swing.JFrame
{
ImageIcon karte[]= new ImageIcon[52];
ImageIcon karo2 = new ImageIcon("H:\\Sola\\Blackjack\\Karte\\karo2.png");
ImageIcon karo3 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo3.png");
ImageIcon karo4 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo4.png");
ImageIcon karo5 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo5.png");
ImageIcon karo6 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo6.png");
ImageIcon karo7 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo7.png");
ImageIcon karo8 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo8.png");
ImageIcon karo9 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo9.png");
ImageIcon karo10 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo10.png");
ImageIcon karoJ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karoJ.png");
ImageIcon karoQ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karoQ.png");
ImageIcon karoK = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karoK.png");
ImageIcon karoAS = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karoAS.png");
ImageIcon kriz2 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz2.png");
ImageIcon kriz3 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz3.png");
ImageIcon kriz4 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz4.png");
ImageIcon kriz5 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz5.png");
ImageIcon kriz6 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz6.png");
ImageIcon kriz7 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz7.png");
ImageIcon kriz8 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz8.png");
ImageIcon kriz9 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz9.png");
ImageIcon kriz10 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz10.png");
ImageIcon krizJ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\krizJ.png");
ImageIcon krizQ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\krizQ.png");
ImageIcon krizK = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\krizK.png");
ImageIcon krizAS = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\krizAS.png");
ImageIcon pik2 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik2.png");
ImageIcon pik3 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik3.png");
ImageIcon pik4 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik4.png");
ImageIcon pik5 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik5.png");
ImageIcon pik6 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik6.png");
ImageIcon pik7 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik7.png");
ImageIcon pik8 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik8.png");
ImageIcon pik9 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik9.png");
ImageIcon pik10 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik10.png");
ImageIcon pikJ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pikJ.png");
ImageIcon pikQ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pikQ.png");
ImageIcon pikK = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pikK.png");
ImageIcon pikAS = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pikAS.png");
ImageIcon srce2 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce2.png");
ImageIcon srce3 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce3.png");
ImageIcon srce4 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce4.png");
ImageIcon srce5 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce5.png");
ImageIcon srce6 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce6.png");
ImageIcon srce7 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce7.png");
ImageIcon srce8 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce8.png");
ImageIcon srce9 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce9.png");
ImageIcon srce10 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce10.png");
ImageIcon srceJ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srceJ.png");
ImageIcon srceQ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srceQ.png");
ImageIcon srceK = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srceK.png");
ImageIcon srceAS = new ImageIcon("H:\\Sola\\Blackjack\\Karte\\srceAS.png");
public Testing() {
initComponents();
}
//
private void initComponents() {
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(255, 0, 0));
jButton1.setText("Hit!");
jButton2.setText("Stand");
jButton3.setText("Hit!");
jButton4.setText("Stand");
jButton5.setText("Deal Again");
jLabel1.setText("jLabel1");
jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel9.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel10.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(209, 209, 209)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
.addGap(6, 6, 6)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField2)
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton2, 0, 0, Short.MAX_VALUE)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField1)
.addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)
.addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)
.addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))))
.addGap(220, 220, 220))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(24, 24, 24)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(48, 48, 48)
.addComponent(jButton5)
.addGap(44, 44, 44)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(43, 43, 43)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton4)
.addComponent(jButton3)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(97, 97, 97))
);
pack();
}//
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new Testing().setVisible(true);
}
});
}
@Override
public void paint(Graphics g)
{
jLabel1.setIcon(karo2);
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
// End of variables declaration
})
Zanima me kako bi spremenil velikosti slik kart ? (original velikost je 200x250)
Že v naprej hvala vsem za pomoč!
(2 stavka kode sta bila odstranjena zaradi neomogočenosti objave(HTML))
Koda:
(package testing;
import java.awt.*;
import javax.swing.*;
public class Testing extends javax.swing.JFrame
{
ImageIcon karte[]= new ImageIcon[52];
ImageIcon karo2 = new ImageIcon("H:\\Sola\\Blackjack\\Karte\\karo2.png");
ImageIcon karo3 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo3.png");
ImageIcon karo4 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo4.png");
ImageIcon karo5 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo5.png");
ImageIcon karo6 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo6.png");
ImageIcon karo7 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo7.png");
ImageIcon karo8 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo8.png");
ImageIcon karo9 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo9.png");
ImageIcon karo10 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karo10.png");
ImageIcon karoJ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karoJ.png");
ImageIcon karoQ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karoQ.png");
ImageIcon karoK = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karoK.png");
ImageIcon karoAS = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\karoAS.png");
ImageIcon kriz2 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz2.png");
ImageIcon kriz3 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz3.png");
ImageIcon kriz4 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz4.png");
ImageIcon kriz5 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz5.png");
ImageIcon kriz6 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz6.png");
ImageIcon kriz7 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz7.png");
ImageIcon kriz8 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz8.png");
ImageIcon kriz9 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz9.png");
ImageIcon kriz10 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\kriz10.png");
ImageIcon krizJ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\krizJ.png");
ImageIcon krizQ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\krizQ.png");
ImageIcon krizK = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\krizK.png");
ImageIcon krizAS = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\krizAS.png");
ImageIcon pik2 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik2.png");
ImageIcon pik3 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik3.png");
ImageIcon pik4 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik4.png");
ImageIcon pik5 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik5.png");
ImageIcon pik6 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik6.png");
ImageIcon pik7 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik7.png");
ImageIcon pik8 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik8.png");
ImageIcon pik9 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik9.png");
ImageIcon pik10 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pik10.png");
ImageIcon pikJ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pikJ.png");
ImageIcon pikQ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pikQ.png");
ImageIcon pikK = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pikK.png");
ImageIcon pikAS = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\pikAS.png");
ImageIcon srce2 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce2.png");
ImageIcon srce3 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce3.png");
ImageIcon srce4 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce4.png");
ImageIcon srce5 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce5.png");
ImageIcon srce6 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce6.png");
ImageIcon srce7 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce7.png");
ImageIcon srce8 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce8.png");
ImageIcon srce9 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce9.png");
ImageIcon srce10 = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srce10.png");
ImageIcon srceJ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srceJ.png");
ImageIcon srceQ = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srceQ.png");
ImageIcon srceK = new ImageIcon("F:\\Sola\\Blackjack\\Karte\\srceK.png");
ImageIcon srceAS = new ImageIcon("H:\\Sola\\Blackjack\\Karte\\srceAS.png");
public Testing() {
initComponents();
}
//
private void initComponents() {
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
jButton5 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setBackground(new java.awt.Color(255, 0, 0));
jButton1.setText("Hit!");
jButton2.setText("Stand");
jButton3.setText("Hit!");
jButton4.setText("Stand");
jButton5.setText("Deal Again");
jLabel1.setText("jLabel1");
jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel8.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel9.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
jLabel10.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(209, 209, 209)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
.addGap(6, 6, 6)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField2)
.addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton2, 0, 0, Short.MAX_VALUE)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(jTextField1)
.addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)
.addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE)
.addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))))
.addGap(220, 220, 220))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(24, 24, 24)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(48, 48, 48)
.addComponent(jButton5)
.addGap(44, 44, 44)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(43, 43, 43)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton4)
.addComponent(jButton3)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(97, 97, 97))
);
pack();
}//
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new Testing().setVisible(true);
}
});
}
@Override
public void paint(Graphics g)
{
jLabel1.setIcon(karo2);
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
// End of variables declaration
})
- spremenilo: dreamtheater ()
keworkian ::
Kaj pa ce bi naredil razred, ki ti jih zmanjsa na tako varianto? :D
Obscenities in B-Flat
overlord_tm ::
poglej java2d, ce sem prav razumel kaj hoces.
Resize
Drugace pa, v swingu ponavadi uporablja paintComponent, ne paint. Pa baje je fajn ce klices se funkcionalnost overridane metode.
Pa z absolutnimi naslovi datotek bos mel kriz, ko bos hotel na kakem drugem kompu pognat program ;)
Resize
Drugace pa, v swingu ponavadi uporablja paintComponent, ne paint. Pa baje je fajn ce klices se funkcionalnost overridane metode.
Pa z absolutnimi naslovi datotek bos mel kriz, ko bos hotel na kakem drugem kompu pognat program ;)
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | [Netbeans-Java]Embossing,blurring,sharpeningOddelek: Programiranje | 1146 (1048) | t3hn0 |
» | [Java] Ne zažene appletaOddelek: Programiranje | 1217 (1150) | iggy |
» | [Java] Zagon appleta v HTMLOddelek: Programiranje | 1557 (1379) | Bela01 |
» | [JAVA] branje iz datotekeOddelek: Programiranje | 2422 (2057) | Bela01 |
» | [Java]VprašanjaOddelek: Programiranje | 2116 (1584) | Bela01 |