Subversion Repository Public Repository

TransPort_Tracking

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.transtracking.views;

import java.awt.Color;
import javax.swing.JFrame;
import javax.swing.JLabel;

/**
 *
 * @author Girija Sahu
 */
public class AbstractForm extends JFrame{
    
     private JLabel feedbackLabel;

  public AbstractForm( String formName) {
    super();
    setResizable(false);
    setExtendedState(this.getExtendedState() | this.MAXIMIZED_BOTH);
        
  }

  protected void setFeedbackLabel(JLabel feedbackLabel) {
    this.feedbackLabel = feedbackLabel;
  }

  public void setError(String text) {
    setFeedbackMessage(text, Color.RED);
  }

  public void setInfo(String text) {
    setFeedbackMessage(text, Color.BLACK);
  }

  private void setFeedbackMessage(String text, Color feedbackColor) {
    if (feedbackLabel == null) {
      //System.out.println(text);
      return;
    }
    if (text == null) {
      feedbackLabel.setText(" ");
      return;
    }
    feedbackLabel.setForeground(feedbackColor);
    feedbackLabel.setText(text);
  }
    
}

Commits for TransPort_Tracking/TransPortTracking/src/main/java/com/bestray/transtracking/views/AbstractForm.java

Diff revisions: vs.
Revision Author Commited Message
1 girijabapi picture girijabapi Sat 28 Jul, 2018 05:29:14 +0000