Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
JPanel pnl = wieEsAuchImmerHeissenMag;
JComponent[] arr = pnl.getComponents();
JCheckBox ckb;
for ( String name : options )
{
for ( JComponent comp : arr )
{
if ( comp.getName().equals(options[i] )
{
ckb = (JCheckBox) comp;
if ( ckb.isSelected() )
{ tuWasImmerDuAuchWillst(); }
}
}
}
String options[] = { "A60", "A61", "A62", "A63", "A67", "A68", "G21",
"G22", "G23", "G26", "G28", "G31", "G32", "G38", "G41", "G42",
"G43", "G46", "G91", "G93", "G47", "G48", "G49",
// [....und so weiter
};
for (int i = 0; i < options.length; i++) {
String fieldName = "cb_" + options[i];
try {
JCheckBox c = (JCheckBox) Output.class.getDeclaredField(
fieldName).get(null);
if (c.isSelected()) {
// ...
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
[...]
; Description: aaaa
;
; User:
;
; REVISIONS:
;
; Options: A60, K33, L81, M64, U10, U11,
;==============================================================================
[...]
ublic class LeseDatei {
{
DateiChooser.auswahlDatei();
String options[] = {"A60", "A61", "A62", "A63", "A67", "A68",
"G21", "G22", "G23", "G26", "G28", "G31", "G32", "G38", "G41", "G42",
"G43", "G46", "G91", "G93", "G47", "G48", "G49",
"K20", "K21", "K29", "K31", "K32", "K33", "K34", "K35", "K36", "K50",
"K68", "K69", "K73", "K79",
"L03", "L09", "L29", "L50", "L55", "L81", "L82", "L91", "L93", "L95",
"M12", "M36", "M37", "M42", "M61", "M64", "M67",
"N26", "N30", "N31", "N32", "N33", "N35", "N36", "N37", "N38", "N44",
"N45", "N83",
"P82", "U01", "U02", "U03", "U10", "U11", "Y09", "Y10", "Y41", "W41", };
String option = "; Options:";
try
{
FileInputStream inputstream=new FileInputStream(DateiChooser.uebergabe);
InputStreamReader reader=new InputStreamReader(inputstream);
BufferedReader bff=new BufferedReader(reader);
for (int i=0;i<800;i++)
{
String vergleich = bff.readLine();
if(vergleich.startsWith(option)) {
StringTokenizer st = new StringTokenizer(vergleich, " ");
System.out.println("AnzahlToken: " + st.countTokens());
// Hier soll eine Schleife rein, die den Token mit meinen options[] vergleicht und dann irgendwas macht
// Aber vorsicht: der Token lautet z.B.: "A60," - also mit komma.
// mit .startswith hab ichs schon versucht. Habs nach x-maligem testen und tüfteln nicht hinbekommen
}
break;
}
} catch (Exception exp) {
System.out.println("Wurde nicht gefunden...");
}
}
}
public class LeseDatei {
{
DateiChooser.auswahlDatei();
String options[] = {"A60", "A61", "A62", "A63", "A67", "A68",
"G21", "G22", "G23", "G26", "G28", "G31", "G32", "G38", "G41", "G42",
"G43", "G46", "G91", "G93", "G47", "G48", "G49",
"K20", "K21", "K29", "K31", "K32", "K33", "K34", "K35", "K36", "K50",
"K68", "K69", "K73", "K79",
"L03", "L09", "L29", "L50", "L55", "L81", "L82", "L91", "L93", "L95",
"M12", "M36", "M37", "M42", "M61", "M64", "M67",
"N26", "N30", "N31", "N32", "N33", "N35", "N36", "N37", "N38", "N44",
"N45", "N83",
"P82", "U01", "U02", "U03", "U10", "U11", "Y09", "Y10", "Y41", "W41", };
String option = "; Options:";
try
{
FileInputStream inputstream=new FileInputStream(DateiChooser.uebergabe);
InputStreamReader reader=new InputStreamReader(inputstream);
BufferedReader bff=new BufferedReader(reader);
for (int i=0;i<800;i++)
{
String vergleich = bff.readLine();
if(vergleich.startsWith(option)) {
StringTokenizer st = new StringTokenizer(vergleich, " ");
System.out.println("AnzahlToken: " + st.countTokens());
while (st.hasMoreTokens()) {
String vergleich2 = st.nextToken();
for(int x=0; x<options.length; x++){
if(vergleich2.startsWith(options[x])){
System.out.println("option: " + options[x]);
}
}
}
}
}
} catch (Exception exp) {
System.out.println("Wurde nicht gefunden...");
}
}
}
public class Test {
public static void main(String[]args)
{
String options[] = {"A60", "A61", "A62", "A63", "A67", "A68",
"G21", "G22", "G23", "G26", "G28", "G31", "G32", "G38", "G41", "G42",
"G43", "G46", "G91", "G93", "G47", "G48", "G49",
"K20", "K21", "K29", "K31", "K32", "K33", "K34", "K35", "K36", "K50",
"K68", "K69", "K73", "K79",
"L03", "L09", "L29", "L50", "L55", "L81", "L82", "L91", "L93", "L95",
"M12", "M36", "M37", "M42", "M61", "M64", "M67",
"N26", "N30", "N31", "N32", "N33", "N35", "N36", "N37", "N38", "N44",
"N45", "N83",
"P82", "U01", "U02", "U03", "U10", "U11", "Y09", "Y10", "Y41", "W41", };
String option = "; Options:";
try
{
String sim[] = new String[10];
sim[0] = ";Description: aaaa";
sim[1] = ";";
sim[2] = "; User:";
sim[3] = ";";
sim[4] = "; REVISIONS:";
sim[5] = ";";
sim[6] = "; Options: A60, K33, L81, M64, U10, U11,";
sim[7] = ";==============================================================================";
sim[8] = "";
sim[9] = ";------------------------------------------------------------------------------";
System.out.println(sim.length);
for (int i = 0; i < sim.length; i++)
{
if(sim[i].contains("Options:"))
{
sim[i] = sim[i].replace(";", "");
sim[i] = sim[i].replace(" ","");
sim[i] = sim[i].replace("Options:","");
String[]Temp = sim[i].split(",");
for(int j=0; j<options.length; j++ )
{
for (int j2 = 0; j2 < Temp.length; j2++)
{
if(Temp[j2].equals(options[j]))
{
System.out.println(options[j] + "=vorhanden");
}
else
{
}
}
}
}
}
} catch (Exception exp) {
System.out.println("Wurde nicht gefunden...");
}
}
}
void Beispiel()
{
// Checkboxen in HashTable speichern
JPanel pnl = wieEsAuchImmerHeissenMag;
Hashtable<String,javax.swing.JCheckBox> tbl;
Component[] arr = pnl.getComponents();
javax.swing.JCheckBox ckb;
for ( String name : options )
{
for ( Component comp : arr )
{
if ( comp.getName().equals(options[i] )
{
ckb = (JCheckBox) comp;
tbl.put(name, ckb);
}
}
}
// ...
while (st.hasMoreTokens())
{
String vergleich2 = st.nextToken();
vergleich2.replaceAll(",","");
ckb = tbl.get(vergleich2);
if ( ckb == null ) continue;
// tuWasImmerDuAuchWillst();
}
}