I'm familiar how to use for loops,
for(HomeButtons BtnInfo : HomeButtons.values())
{
if(BtnInfo.getEnum().equalsIgnoreCase("NOVALUE")==false)
{
System.out.println("Name:" + BtnInfo.getName() + " Test:" + BtnInfo.getText());
JButton tmpBtn = new JButton();
tmpBtn.setName(BtnInfo.getName());
tmpBtn.setText((BtnInfo.getText()));
tmpBtn.setHorizontalTextPosition(SwingConstants.CENTER);
tmpBtn.setVerticalTextPosition(SwingConstants.CENTER);
tmpBtn.setIcon(BtnInfo.getIcon());
tmpBtn.setForeground(TEXT_COLOR);
tmpBtn.setOpaque(false);
tmpBtn.addMouseListener(this);
tmpBtn.setActionCommand(BtnInfo.getEnum());
this.add(tmpBtn);
}
}
The question is, can you do the same thing with a while loop? I'm trying to get that "if" out of this loop.