001: /*
002: * DDS (Data Distribution Service) for JacORB
003: *
004: * Copyright (C) 2005 , Ahmed yehdih <ahmed.yehdih@gmail.com>, fouad
005: * allaoui <fouad.allaoui@gmail.com>, Didier Donsez (didier.donsez@ieee.org)
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Library General Public License
009: * as published by the Free Software Foundation; either version 2
010: * of the License, or (at your option) any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
015: * GNU Library General Public License for more details.
016: *
017: * You should have received a copy of the GNU Library General Public
018: * License along with this program; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
020: * 02111-1307, USA.
021: *
022: * Coontact: Ahmed yehdih <ahmed.yehdih@gmail.com>, fouad allaoui
023: * <fouad.allaoui@gmail.com>, Didier Donsez (didier.donsez@ieee.org)
024: * Contributor(s)
025: *
026: **/
027: package demo.dds.dcps.foosample;
028:
029: public class FooFrame extends javax.swing.JFrame {
030:
031: public String Temperature_String;
032:
033: private javax.swing.JMenuItem exitMenuItem;
034: private javax.swing.JMenu fileMenu;
035: private javax.swing.JLabel jLabel1;
036: private javax.swing.JPanel jPanel1;
037: private javax.swing.JMenuBar menuBar;
038:
039: public FooFrame() {
040: initComponents();
041: }
042:
043: private void initComponents() {
044: jPanel1 = new javax.swing.JPanel();
045: jLabel1 = new javax.swing.JLabel();
046: menuBar = new javax.swing.JMenuBar();
047: fileMenu = new javax.swing.JMenu();
048: exitMenuItem = new javax.swing.JMenuItem();
049:
050: setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
051:
052: jPanel1.setLayout(new java.awt.BorderLayout());
053: jPanel1
054: .addComponentListener(new java.awt.event.ComponentAdapter() {
055: });
056: jLabel1.setBackground(new java.awt.Color(153, 51, 255));
057: jLabel1
058: .setFont(new java.awt.Font("Microsoft Sans Serif", 1,
059: 30));
060: jLabel1
061: .setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
062: jLabel1.setText("jLabel1");
063: jLabel1
064: .addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
065: });
066: jPanel1.add(jLabel1, java.awt.BorderLayout.CENTER);
067:
068: getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
069:
070: fileMenu.setText("File");
071: exitMenuItem.setText("Exit");
072: exitMenuItem
073: .addActionListener(new java.awt.event.ActionListener() {
074: public void actionPerformed(
075: java.awt.event.ActionEvent evt) {
076: exitMenuItemActionPerformed(evt);
077: }
078: });
079:
080: fileMenu.add(exitMenuItem);
081: menuBar.add(fileMenu);
082: setJMenuBar(menuBar);
083: setBounds(500, 350, 300, 200);
084:
085: this .setTitle("Foo");
086: }
087:
088: private void exitMenuItemActionPerformed(
089: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
090: System.exit(0);
091: }
092:
093: public void SetText(double value) {
094: this .jLabel1.setText("" + value);
095: }
096:
097: public void SetText(String message) {
098: this .jLabel1.setText(message);
099: }
100:
101: public void SetColorLablel() {
102: jLabel1.setForeground(new java.awt.Color(204, 0, 0));
103: ;
104: }
105:
106: public static void main(String args[]) {
107: FooFrame Test = new FooFrame();
108: Test.SetText(30);
109: Test.setVisible(true);
110: }
111: }
|