PDA

View Full Version : Change Navigation buttons style



Anatoliy Leonov
01-25-2016, 09:39 AM
To make installation follow our product style guide we need to change navigation buttons(Next, Previous, Continue) look & feel.
I did not found any information about this not in documentation neither in knowledge base.
So does it possible to change navigation buttons to be custom button class (e.g. class derived from JButton)? Or just chagne style of existing buttons to be e.g. solid color buttons with custom font labels?

Thanks!

fivigg
11-21-2016, 02:14 PM
Example how you can change button

public static void changeInstallButton() {
Field fe_l;
try {
fe_l = AAMgr.class.getDeclaredField("al");
fe_l.setAccessible(true);
Method me_a = fe_l.get(AAMgr.getInstance()).getClass()
.getDeclaredMethod("aa");
me_a.setAccessible(false);
Method me_i = me_a.invoke(fe_l.get(AAMgr.getInstance())).getClass()
.getDeclaredMethod("ai");
me_i.setAccessible(false);
Insets in = ((JButton) me_i.invoke(me_a.invoke(fe_l.get(AAMgr
.getInstance())))).getMargin();
in.set(2, 2, 2, 2);
((JButton) me_i.invoke(me_a.invoke(fe_l.get(AAMgr.getInstance()))))
.setMargin(in);

((JButton) me_i.invoke(me_a.invoke(fe_l.get(AAMgr.getInstance())))).setText("Next");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}