Hi!
I have often problems with Layouts. How can I set component at exact location.
I thought I can do
button.setLocation(20,40) but some strange things happens all the time. The problem is with this
Layouts (Flow, Grid, Border...). In C# I think there are not these problems.
Can I turn off all these layouts and put things much simpler. At this time I have this code and when I run this
the table is not showed at window?
public class nothing extends JFrame {
private JTable tabpredmet;
public nothing () {
super("govno");
setLayout(null);
setSize(400, 700);
setVisible(true);
String[][] data = new String[][]{{"Srpski jezik"}, {"Engleski jezik"}, {"Ruski jezik"}};
String[] col = {"Predmet"};
tabpredmet = new JTable(data, col);
tabpredmet.setPreferredScrollableViewportSize(new Dimension(200, 200));
tabpredmet.setFillsViewportHeight(true);
// JScrollPane jscrollpane = new JScrollPane(tabpredmet);
JScrollPane p = new JScrollPane(tabpredmet);
add(p);
p.setVisible(true);
p.setLocation(50, 50);
}
public static void main(String[] args) {
nothing a = new nothing ();
a.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}