Then in construct you can do
setIconImage(tPointerLogo)
(after you've assigned the icon passed in the ctor to an instance variable)
Main Topics
Browse All Topicshi.
i want to put an icon in the header(like the fox icon in the FF browser etc.) instead of the Java icon.
i tried something out,but for now, i only managed to remove the icon at all... :-S
my code looks like that (not all of it, just the parts needed here...)
public class BootStrap
{ static String ImageIconFolder;
static ImageIcon tPointerLogo;
public BootStrap(String timageIconFolder,ImageIcon
ImageIconFolder=timageIcon
tPointerLogo=pointerLogo;
}
public static void main(String args[])
{ String ImageName="\\PointerLogo.j
String ImageFolder="C:\\Temp";
String ImageIconFolder=ImageFolde
tPointerLogo = new ImageIcon(ImageIconFolder)
new LoopSMS("Loop SMS Ver. 1.01");
// LoopSMS.setIconImage(Point
}
}
... //constructor
public LoopSMS(String frameTitle)
{
super(frameTitle);
//initialise components
init();
//construct GUI
construct();
//Display GUI
display();
}
private void construct()
{
ImageIcon PointerLogo = new ImageIcon();
PointerLogo=BootStrap.tPoi
// JFrame MainFrame = new JFrame("Loop SMS Ver. 1.01");
this.setIconImage(PointerL
// MainFrame.setLocationRelat
this.getContentPane().add(
// MainFrame.add(MainFramePan
MainFramePanel.add(DLPanel
....}
how do i fix that?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Different solution:
public static void main(String args[])
{
String ImageName="\\PointerLogo.j
String ImageFolder="C:\\Temp";
String ImageIconFolder=ImageFolde
tPointerLogo = new ImageIcon(ImageIconFolder)
LoopSMS ls = new LoopSMS("Loop SMS Ver. 1.01");
ls.setIconImage(tPointerLo
}
Btw, a lot of rubbish in your code, try to keep your code clean and simple.
I think you are missing the idea of static vs non-static. If you have a class Student and you want an instance of that class you do:
Student instanceStudent = new Student();
Now if you want to call a method on such object you do:
instanceStudent.methodname
This will call the object and all the class-attributes are set for this specific student. While if you do:
Student.attribute;
then you can only do so, if the attribute is static (since Student is not an instance/object but a class name).
So small example:
class Student
{
final static String school = "university college";
public int id;
private int pid;
public Student(int id)
{
this.id = id;
this.pid = id*2;
}
public int getPid()
{
return pid;
}
}
This class has one constructor (namely Student(int id)) and a method getId() which returns the id of the student. There are three attributes, one static (value) and one non-static (id). Id is public, but pid is private.
So lets look at the follow example code:
Student s1 = new Student(10);
System.out.println(Student
System.out.println(Student
System.out.println(s1.id);
System.out.println(s1.getP
System.out.println(s1.pid)
I'm not sure if I explained this well enough for you to understand, but there is a lot of redundancy in your code.
Good luck.
Mark
Business Accounts
Answer for Membership
by: CEHJPosted on 2006-11-19 at 03:20:40ID: 17974130
Pass the icon in the ctor
new LoopSMS("Loop SMS Ver. 1.01", tPointerLogo);