Monday, August 17, 2009

How to add an image to a JPanel

In case of using Netbeans IDE Palettes for GUI building, in order to insert an image into JPanel, you have to change the layout of panel to "Border Layout". Then you have to use a JLabel to pass the image into JPanel.

I have tried many ways but this worked fine for me:

ImageIcon picturetoInsert = newImageIcon("C:/images/anyimage.gif");
JLabel label = new JLabel("",picturetoInsert,JLabel.CENTER);
pPanel.add(label,BorderLayout.CENTER);




Labels: ,

Thursday, January 22, 2009

Windows'ta Netbeans 6.5 ile C geliştirme

Netbeans-6.5'i indir.
Netbeans-6.5 icin c/c++ development package'ini indir.
Netbeans-6.5 i kur.
Netbeans -6.5 icin c/c++ dev. pack'i kur.
MinGW-5.1.4'u indir ve kur. -> gcc for windows
MSYS'i (Not: Bu direct link değil, direct link versen de sonradan kırılır.Buradan MSYS yi kendin bulacaksın) indir ve kur-> kurulumda MinGW'nin yerini soracak ve Netbeans icin gerekli gmake'i kuracaktır.
Artık Netbeans, C/C++ projesi oluşturulmak istendiğinde otomatik olarak C compiler ve tools ayarlarını yapacaktır.
Eger hala make icin ne kullanacagını bulamamışsa : "dizin ismi":\msys\1.0\bin\make.exe'yi kullanmasını sağla.

Labels: , ,