{"action":"opened","issue":{"url":"https://api.github.com/repos/jegoms/ARQDESIS/issues/37","repository_url":"https://api.github.com/repos/jegoms/ARQDESIS","labels_url":"https://api.github.com/repos/jegoms/ARQDESIS/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/jegoms/ARQDESIS/issues/37/comments","events_url":"https://api.github.com/repos/jegoms/ARQDESIS/issues/37/events","html_url":"https://github.com/jegoms/ARQDESIS/issues/37","id":138847388,"number":37,"title":"TelaSaldo","user":{"login":"jegoms","id":17679731,"avatar_url":"https://avatars.githubusercontent.com/u/17679731?v=3","gravatar_id":"","url":"https://api.github.com/users/jegoms","html_url":"https://github.com/jegoms","followers_url":"https://api.github.com/users/jegoms/followers","following_url":"https://api.github.com/users/jegoms/following{/other_user}","gists_url":"https://api.github.com/users/jegoms/gists{/gist_id}","starred_url":"https://api.github.com/users/jegoms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jegoms/subscriptions","organizations_url":"https://api.github.com/users/jegoms/orgs","repos_url":"https://api.github.com/users/jegoms/repos","events_url":"https://api.github.com/users/jegoms/events{/privacy}","received_events_url":"https://api.github.com/users/jegoms/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-06T22:59:35Z","updated_at":"2016-03-06T22:59:35Z","closed_at":null,"body":"import java.awt.*;\r\nimport java.awt.event.*;\r\nimport javax.swing.*;\r\nimport javax.swing.border.*;\r\nimport java.util.*;\r\nimport java.text.*;\r\n\r\npublic class TelaSaldo extends JFrame implements ActionListener\r\n{\r\n\tprivate JLabel lTitular, lData, lSaldo, lSaldoJ;\r\n\tprivate JTextField tData, tSaldo;\r\n\tprivate JButton bImprimir, bVoltar;\r\n\tprivate JPanel pTitular, pBotoes;\r\n\tprivate Container c;\r\n\tprivate SimpleDateFormat sdf;\r\n\tprivate ResourceBundle bn = null;\r\n   private String lingua, pais;\r\n   private Conta co;  \r\n\t\r\n\tpublic TelaSaldo(String lingua, String pais, JLabel lTitular, Conta co)\r\n\t{\r\n      super();\r\n      c = getContentPane();\r\n      c.setLayout(new BorderLayout());\r\n\t\t\r\n\t\tthis.lingua = lingua;\r\n      this.pais = pais;\r\n\t\tthis.co = co;\r\n\t\t\r\n\t\tlData = new JLabel(\"Data: \");\r\n\t\tlSaldo = new JLabel(\"Saldo: \");\r\n\t\tlSaldoJ = new JLabel(\"Saldo\");\r\n\t\tthis.lTitular = lTitular;\r\n\t\t\r\n\t\ttData = new JTextField(10);\r\n\t\ttSaldo = new JTextField(10);\r\n\t\ttData.setEditable(false);\r\n      tSaldo.setEditable(false);      \r\n      \r\n      sdf = new SimpleDateFormat(\"dd/MM/yyyy\");  \r\n      String data = sdf.format(new Date());\r\n      tData.setText(data);\r\n      \r\n      tSaldo.setText(co.getSaldoS());\r\n      \r\n\t\tbImprimir = new JButton(\"Imprimir\");\r\n\t\tbVoltar = new JButton(\"Voltar\");\r\n      bImprimir.addActionListener(this);\r\n      bVoltar.addActionListener(this);     \r\n\t\t\r\n\t\t//paineis\t\t\t\t\t\r\n\t\tpBotoes = new JPanel(new FlowLayout());\r\n\t\tpBotoes.add(bImprimir);\r\n\t\tpBotoes.add(bVoltar);\t\t\r\n\r\n\t\tpTitular = new JPanel(new FlowLayout());\r\n\t\tpTitular.add(lTitular);\r\n\t\t\r\n\t\tPanel pInformacoes = new Panel(new GridBagLayout());\r\n      GridBagConstraints gbc = new GridBagConstraints();      \r\n      gbc.gridx = 0;\r\n      gbc.gridy = 0;\r\n      pInformacoes.add(lData, gbc);\r\n      gbc.gridx = 1;\r\n      gbc.gridy = 0;\r\n      pInformacoes.add(tData, gbc);      \r\n      gbc.gridx = 0;\r\n      gbc.gridy = 1;\r\n\t\tpInformacoes.add(lSaldo, gbc);\r\n      gbc.gridx = 1;\r\n      gbc.gridy = 1;\r\n\t\tpInformacoes.add(tSaldo, gbc);         \r\n      \r\n      JPanel pAux = new JPanel(new BorderLayout());\r\n      pAux.add(pBotoes, BorderLayout.EAST);\r\n\t\t\r\n\t\t\r\n\t\tsetTitle(\"Banco 'X'\"); \r\n\t\tescolhaIdioma(lingua, pais);\r\n\t\t\r\n      //quadrinho\r\n      JPanel p = new JPanel(new BorderLayout());\r\n      p.add(pInformacoes, BorderLayout.CENTER);\r\n      TitledBorder t = new TitledBorder(lSaldoJ.getText());\r\n      p.setBorder(t);\r\n      \r\n\t\t//container\r\n\t\tc.add(pTitular, BorderLayout.NORTH);\r\n\t\tc.add(p, BorderLayout.CENTER);\r\n\t\tc.add(pAux, BorderLayout.SOUTH);\r\n\t\t\r\n\t\t//detalhes\r\n\t\tImageIcon icone2 = new ImageIcon(\"2.png\"); //https://macmagazine.com.br/wp-content/uploads/2012/06/27-ibank_icon.png\r\n      setIconImage(icone2.getImage()); //altera o ícone da janela         \r\n      Dimension tela = Toolkit.getDefaultToolkit().getScreenSize();  \r\n      setLocation((((tela.width-this.getSize().width)/2)-250), ((tela.height-this.getSize().height)/2)-200);            \r\n\t\tsetSize(500, 400);\r\n      setResizable(false);\r\n\t\tsetVisible(true);\r\n\t}\r\n\t\r\n\tpublic void escolhaIdioma(String lingua, String pais) \r\n   { \r\n      Locale.setDefault(new Locale(lingua, pais));\r\n      Locale locale = Locale.getDefault();\r\n       \r\n      bn = ResourceBundle.getBundle(\"Traducao\", locale);\r\n       \r\n      lData.setText(bn.getString(\"rotulo.data\"));\r\n      lSaldo.setText(bn.getString(\"rotulo.saldo\"));\r\n      bImprimir.setText(bn.getString(\"botao.imprimir\"));\r\n      bVoltar.setText(bn.getString(\"botao.voltar\"));\r\n      setTitle(bn.getString(\"titulo\")); \r\n\t\tlSaldoJ.setText(bn.getString(\"saldo\"));\r\n    }\r\n\t\r\n   public void actionPerformed(ActionEvent event)\r\n   {\r\n\t\tString titular = \"\";\r\n      if(event.getSource() == bImprimir)\r\n      {\r\n\t\t\ttitular = \"\" + lTitular.getText();\r\n\t\t\tImpressaoSaldo is = new ImpressaoSaldo(lingua, pais, co, titular);\r\n      }\r\n      \r\n      if(event.getSource() == bVoltar)\r\n      {\r\n         dispose();\r\n      }      \r\n   }\r\n   \r\n}"}}