ich habe zwar diverse Dinge ergoogelt und ausprobiert, aber so richtig will es nicht funktionieren....
ich schaffe es nicht, dass das JApplet auch in der Höhe den gesamten freien Browserbereich ausnutzt.. wie erreiche ich das bitte ?
Die HTML Seite:
Die StartKlasse:
Die DesignBuilder Klasse:
ich schaffe es nicht, dass das JApplet auch in der Höhe den gesamten freien Browserbereich ausnutzt.. wie erreiche ich das bitte ?
Die HTML Seite:
Java:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>NOUS</title>
<meta name="author" content="Muh">
<meta name="editor" content="html-editor phase 5">
<style type="text/css" media="all">
html, body {
background-color: #333333;
margin: 0;
padding: 0;
height: 100%; /* WICHTIG!!! STRECKT ANZEIGENBEREICH AUF 100% */
}
#wrapper {
background-color: #FFFFFF;
width: 80%;
margin: auto; /* Div soll zentriert werden */
min-height: 100%; /* Mindesthöhe für moderne Browser */
height:auto !important; /* Important Regel für moderne Browser */
height:100%; /* Mindesthöhe für den IE */
overflow: hidden !important; /* FF Scroll-leiste */
}
</style>
</head>
<body>
<div id="wrapper">
<APPLET CODE="Start.class" codebase="bin" height = "100%" width="100%">
</APPLET>
</div>
</body>
</html>
Die StartKlasse:
Java:
import javax.swing.JApplet;
import GUI.*;
public class Start extends JApplet {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* @param args
*/
public void init() {
DesignBuilder.Start(getContentPane());
}
.......
}
Die DesignBuilder Klasse:
Java:
import java.awt.*;
import javax.swing.*;
public class DesignBuilder {
static void addComponent(Container cont, GridBagLayout gbl, Component c,
int x, int y, int width, int height, double weightx, double weighty) {
GridBagConstraints gbc = new GridBagConstraints();
gbc.fill = GridBagConstraints.BOTH;
gbc.gridx = x;
gbc.gridy = y;
gbc.gridwidth = width;
gbc.gridheight = height;
gbc.weightx = weightx;
gbc.weighty = weighty;
gbl.setConstraints(c, gbc);
cont.add(c);
}
public static void Start(Container a) {
GridBagLayout gbl = new GridBagLayout();
a.setLayout(gbl);
addComponent( a, gbl, new JButton("1"), 0, 0, 2, 2, 1.0, 1.0 );
addComponent( a, gbl, new JButton("2"), 2, 0, 1, 1, 0 , 1.0 );
addComponent( a, gbl, new JButton("3"), 2, 1, 1, 1, 0 , 0 );
addComponent( a, gbl, new JButton("4"), 0, 2, 3, 1, 0 , 1.0 );
addComponent( a, gbl, new JButton("5"), 0, 3, 2, 1, 0 , 0 );
addComponent( a, gbl, new JButton("6"), 0, 4, 2, 1, 0 , 0 );
addComponent( a, gbl, new JButton("7"), 2, 3, 1, 2, 0 , 0 );
}
}