i'am using JTransformer class from swinghelper
https://swinghelper.dev.java.net/
when i chose flowlayout there is no problem but if i use null layout i cant see my button on frame
any help would be appreciated.
import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.geom.AffineTransform; import java.util.ArrayList; import java.util.List; import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.border.EtchedBorder;
import org.jdesktop.swinghelper.transformer.JXTransformer;
public class Main {
/**
* @param args
*/
private List<JXTransformer> transformers = new ArrayList<JXTransformer>();
private JXTransformer createTransformer(JComponent c) {
JXTransformer t = new JXTransformer(c);
transformers.add(t);
return t;
}
public void fonk() {
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setLayout(new FlowLayout());
//f.setLayout(null);
f.setBounds(500,500,500,500);
JButton b = new JButton("JButton");
b.setSize(10,10);
b.setLocation(10,10);
f.add(createTransformer(b));
AffineTransform at = new AffineTransform();
at.rotate(45 * Math.PI / 180);
for (JXTransformer t : transformers) {
t.setTransform(at);
}
f.show();
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new Main().fonk();
}
}