aboutsummaryrefslogtreecommitdiff
path: root/JBriscola/all_versions/0.1/0.1.1/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.1/src/OptionFrame.java
downloadancient-projects-master.tar.gz
ancient-projects-master.zip
I found my old code!HEADmaster
Diffstat (limited to 'JBriscola/all_versions/0.1/0.1.1/src/OptionFrame.java')
-rwxr-xr-xJBriscola/all_versions/0.1/0.1.1/src/OptionFrame.java87
1 files changed, 87 insertions, 0 deletions
diff --git a/JBriscola/all_versions/0.1/0.1.1/src/OptionFrame.java b/JBriscola/all_versions/0.1/0.1.1/src/OptionFrame.java
new file mode 100755
index 0000000..bd6f0da
--- /dev/null
+++ b/JBriscola/all_versions/0.1/0.1.1/src/OptionFrame.java
@@ -0,0 +1,87 @@
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 case 2:
53 lang = "bl";
54 break;
55 case 3:
56 lang = "bv";
57 break;
58 default:
59 lang = "it";
60 break;
61 }
62 formatter.format( lang );
63 formatter.close();
64 main.settaOpzioni();
65 OptionFrame.this.dispose();
66 JOptionPane.showMessageDialog( OptionFrame.this, main.stringaNecessarioRiavviare, "JBriscola 0.1", JOptionPane.INFORMATION_MESSAGE );
67 }
68 });
69 annulla = new JButton( main.stringaAnnulla );
70 annulla.addActionListener( new ActionListener() {
71 public void actionPerformed( ActionEvent e ) {
72 OptionFrame.this.dispose();
73 }
74 });
75 lingua = new JLabel( main.stringaLingua );
76 String[] lingueDaSelezionare = { main.stringaIt, main.stringaLa, main.stringaBL, main.stringaBV };
77 selezionaLingua = new JComboBox( lingueDaSelezionare );
78 pannello1 = new JPanel( new FlowLayout() );
79 pannello1.add( lingua );
80 pannello1.add( selezionaLingua );
81 pannello2 = new JPanel( new FlowLayout() );
82 pannello2.add( ok );
83 pannello2.add( annulla );
84 add( pannello1, BorderLayout.CENTER );
85 add( pannello2, BorderLayout.SOUTH );
86 }
87}

Generated with cgit - Back to sebastiano.tronto.net