I'm resizing a JPopupMenu and while I can resize font and menu item size just fine, I'm unable to resize other menu things. E.g. shortcut labels or arrows to expand the menu remain small; as can be seen here:
e.g., "Ctrl+C" label (or the arrow next to "Font") has the same size in both menus even though I'd want it bigger in the zoomed menu.
How could I accomplish this?
This is how I resize font and menu item size
//aCollection is a collection with menu items (separators, jmenuitems, etc.) which i want to resize
//aJContainer is a container (JPopupMenu in this case) where I'm adding the resized components
private void addCollectionToJContainer(JComponent aJContainer, Collection aCollection){
double WEBSTART_ZOOM_FACTOR = 2.5;
Iterator i = aCollection.iterator();
while (i.hasNext()) {
JComponent item = (JComponent) i.next();
try{
Font f = ((JMenuItem) item).getFont();
((JMenuItem) item).setFont(new Font(f.getName(), f.getStyle(), (int) Math.round(f.getSize() * WEBSTART_ZOOM_FACTOR)));
int w = (int) Math.round(item.getPreferredSize().getWidth() * WEBSTART_ZOOM_FACTOR);
int h = (int) Math.round(item.getPreferredSize().getHeight() * WEBSTART_ZOOM_FACTOR);
item.setPreferredSize(new Dimension(w, h));
}catch(ClassCastException e){ //item is a separator
}
aJContainer.add(item);
}
}