• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help about

 
Per kermel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im trying to make a dictonary, where teh ppl who runs the application gets on word in norewgain etc and 3 words in english, but only 1 is the same meaning as the norwegian, when the ppl have answerd the same quiz correctly 4 times the prog shall not use the quiz anymore.. somone plz help?`
public class OrdBokGUI extends JFrame {
public OrdBokGUI() {
setTitle("Tren P� Utlandske Ord");
Conteiner cp = getContentPane();
cp.add(new Overskrift(),Borderlayout,NORTH);
cp.add(new TreningsPanel(),Borderlayout,CENTER);
cp.add(new LukkKnapp(),Borderlayput,SOUTH);
}
}
thats what i made so fare..
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This uses JOptionPanes, not a GUI. It's a bit rough, but seems to work OK.

this is the contents of "Test.txt" - needs to be in this style
norwegian word,english word1,english word2,english word3,number of correct answer (0-based)
nor1,eng1,eng2,eng3,0
nor2,eng1,eng2,eng3,1
nor3,eng1,eng2,eng3,2
nor4,eng1,eng2,eng3,0
nor5,eng1,eng2,eng3,1
nor6,eng1,eng2,eng3,2
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"okcomputer kermel",
Sorry, but your display name does not comply to the JavaRanch Display name rules explained here.
Your display name must be two words: your first name, then your last name, and fictitious names are not allowed.
You can edit your profile with a valid display name here.
Thanks,
Dave.
ps Welcome to the Ranch! I hope you get all your questions answered!
 
Per kermel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
didoes have to be a gui..
need some classes for close button etc.. and header
thing is that i have to inmport a file of the web,,, with the forgin language on it.. just called it tjekkisk.n2a... but dunno how that works
but if somone could comment on some bad programming..
import java.awt.*;
import java.swing.*;
import java.io.*;
import java.net.*;
import java.util.*;
public class Panel extends JPanel
{
public Panel()
{
String testfil = "tsjekkisk.n2a";
try{
setLayout(new BorderLayout());
// Et panel som innholder 2 knapper som skal lese en ordliste
Jpanel nPan = new JPanel(new GrindLayout(0,2));
add(nPan,BorderLayout.NORTH);
JButton lesFilFraKnapp = new JButton("ordliste lokalt");
JButton lesWebFraKnapp = new JButton("ordliste web");
nPan.add(lesFilFraKnapp);
nPan.add(lesFilWebKnapp);
//Norsk ord med forklaringer
JPanel cPan = new JPanel();
add(cPan,BorderLayout.CENTER);
JLabel FNorskOrd = new JLabel("Hva betyr dette");
JTextField KNorskOrd = new JTextField("hus",20);
c.Pan.add(FNorskOrd);
c.Pan.add(KNorskOrd);
//panel som har knapper som henter ord
JPanel sPan = new JPanel(new GrindLayout(0,3));
add(sPan,BorderLayout.SOUTH);
JButton ordKnapp1 = new ordKnapp();
JButton ordKnapp2 = new ordKnapp();
JButton ordKnapp3 = new ordKnapp();

sPan.add(ordKnapp1);
sPan.add(ordKnapp2);
sPan.add(ordKnapp3);
Properties p = new Properties();
p.load(new FileInputStream(testfil));
}
catch(IOException fnf) {}
Properties p = System.getProperties();
p.list(System.out);
}
}
 
Per kermel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm.. found javax.swing....
still doesnt run...
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPanel sPan = new JPanel(new GrindLayout(0,3));
add(sPan,BorderLayout.SOUTH);

I think you mean: ....(new GridLayout(0,3));
Have a read of the Swing Tutorial
HTH
Nigel
 
Per kermel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
looked at it.. very uisfuk thx.. but need a buttons read from(lesFraFil)
could somone complete it im out of ideas?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic