aboutsummaryrefslogtreecommitdiff
path: root/JBriscola/all_versions/0.1/0.1 Beta 2/src/OptionFrame.java
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-03-26 19:27:18 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2026-03-26 19:27:18 +0100
commit7167b4341ef290d56fb96e2af10883a4b925d83b (patch)
tree1eb1b9e5ab82ddd89540e68d6b22ae69514575c6 /JBriscola/all_versions/0.1/0.1 Beta 2/src/OptionFrame.java
downloadancient-projects-7167b4341ef290d56fb96e2af10883a4b925d83b.tar.gz
ancient-projects-7167b4341ef290d56fb96e2af10883a4b925d83b.zip
I found my old code!HEADmaster
Diffstat (limited to 'JBriscola/all_versions/0.1/0.1 Beta 2/src/OptionFrame.java')
-rwxr-xr-xJBriscola/all_versions/0.1/0.1 Beta 2/src/OptionFrame.java83
1 files changed, 83 insertions, 0 deletions
diff --git a/JBriscola/all_versions/0.1/0.1 Beta 2/src/OptionFrame.java b/JBriscola/all_versions/0.1/0.1 Beta 2/src/OptionFrame.java
new file mode 100755
index 0000000..de6734b
--- /dev/null
+++ b/JBriscola/all_versions/0.1/0.1 Beta 2/src/OptionFrame.java
@@ -0,0 +1,83 @@
1/*
2Copyright 2009 Sebastiano Tronto <sebastiano@luganega.org>
3
4This file is part of JBriscola.
5
6 JBriscola is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 JBriscola is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with JBriscola; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
20*/
21
22import java.util.Formatter;
23import javax.swing.*;
24import java.awt.*;
25import java.awt.event.*;
26
27public class OptionFrame extends JFrame {
28 public static Main main = new Main();
29 public static Formatter formatter;
30 public static JButton ok, annulla;
31 public static JLabel lingua;
32 public static JComboBox selezionaLingua;
33 public static JPanel pannello1, pannello2;
34 public OptionFrame() {
35 super( "JBriscola - " + main.stringaModificaOpzioni );
36 ok = new JButton( "OK" );
37 ok.addActionListener( new ActionListener() {
38 public void actionPerformed( ActionEvent e ) {
39 try {
40 formatter = new Formatter( "JBriscolaConfig.txt" );
41 } catch ( Exception ex ) {
42 JOptionPane.showMessageDialog( OptionFrame.this, main.stringaImpossibileConfigurare + ex );
43 }
44 String lang;
45 switch ( selezionaLingua.getSelectedIndex() ) {
46 case 0:
47 lang = "it";
48 break;
49 case 1:
50 lang = "la";
51 break;
52 default:
53 lang = "it";
54 break;
55 }
56 formatter.format( lang );
57 formatter.close();
58 main.settaOpzioni();
59 main.frame.pannello.repaint();
60 main.frame.repaint();
61 OptionFrame.this.dispose();
62 JOptionPane.showMessageDialog( OptionFrame.this, main.stringaNecessarioRiavviare, "JBriscola 0.1", JOptionPane.INFORMATION_MESSAGE );
63 }
64 });
65 annulla = new JButton( main.stringaAnnulla );
66 annulla.addActionListener( new ActionListener() {
67 public void actionPerformed( ActionEvent e ) {
68 OptionFrame.this.dispose();
69 }
70 });
71 lingua = new JLabel( main.stringaLingua );
72 String[] lingueDaSelezionare = { main.stringaIt, main.stringaLa };
73 selezionaLingua = new JComboBox( lingueDaSelezionare );
74 pannello1 = new JPanel( new FlowLayout() );
75 pannello1.add( lingua );
76 pannello1.add( selezionaLingua );
77 pannello2 = new JPanel( new FlowLayout() );
78 pannello2.add( ok );
79 pannello2.add( annulla );
80 add( pannello1, BorderLayout.CENTER );
81 add( pannello2, BorderLayout.SOUTH );
82 }
83}

Generated with cgit - Back to sebastiano.tronto.net