Skip to main content

warping Button text

2 replies [Last post]
heziflash
Offline
Joined: 2008-06-03

Hi

I create 4 Buttons and i want the text to warp around but the only one that is warping, is b1, becouse of the 2 lines:
b1.getStyle() .setPadding(Component.RIGHT, 20);
b1.getStyle().setPadding(Component.LEFT,20);

if i'll add the 2 lines to b2 , only b2 will warp.
How can i do that when the button is getting focus , the text will warp.

Here is my code:

Container cnt1 = new Container(new BoxLayout(BoxLayout.Y_AXIS));
final Button b1 = new Button("Refill");

b1.getStyle().setBgTransparency(120);

b1.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

}
});

b1.getStyle() .setPadding(Component.RIGHT, 20);
b1.getStyle().setPadding(Component.LEFT,20);

b1.setNextFocusRight(b);

final Button b2 = new Button("Brkpoint ");
b2.getStyle().setBgTransparency(120);

b2.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {
}
});

b2 .setNextFocusRight(b);

final Button b3 = new Button("Regret");
b3.getStyle().setBgTransparency(120);

b3.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {
}
});
b3.setNextFocusRight(b);

final Button b4 = new Button("Statistic");
b4.getStyle().setBgTransparency(120);

b4.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent evt) {

}
});
b4.setNextFocusRight(b);

cnt1.addComponent(b1);
cnt1.addComponent(b2);
cnt1.addComponent(b3);
cnt1.addComponent(b4);

f.addComponent(BorderLayout.WEST, cnt1);

Thanks,
Hezi

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
heziflash
Offline
Joined: 2008-06-03

Hi

Can somebody help me with this question?

Thanks,
Hezi

asterfr
Offline
Joined: 2008-07-17

I've tried an answer but you already done what i would have suggested.

Sorry