public class TestLabelBox extends JFrame {
private static final long serialVersionUID = 1L;
private JPanel panel1 = new JPanel();
private Color color1 = new Color(0,0,255);
private Color color2 = new Color(0,255,0);
private Color color3 = new Color(255,0,0);
public TestLabelBox(){
super();
panel1.setLayout(new FlowLayout(FlowLayout.LEFT));
panel1.add(new MyLabel(color1,"A "));
panel1.add(new MyLabel(color2,"B "));
panel1.add(new MyLabel(color3,"C "));
add(panel1);
// this.pack();
}
/**
* @param args
*/
public static void main(String[] args) {
run(new TestLabelBox(),200,100);
}
}
class MyLabel extends JLabel
{
private Color color;
private int width = 16;
private int height = 13;
private int x = 20;
private int y = 2;
public MyLabel(){
super();
}
public MyLabel(Color color,String text){
super(text);
// setSize(4000, 25);
// setBounds(new Rectangle(27, 25, 42, 15));
this.color=color;
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(color);
g.drawRect(x, y, width, height);
}
}
分享到:
相关推荐
matlab开发-myLabel014。一种用于图像序列像素级标记的图形工具。
mylabel.cpp
MyLabel.cs
myLabel 是一个用于手动标记图像序列的工具。 标记图像在计算机视觉中有很多应用(例如训练、评估等)。 要运行该工具,只需将存档解压缩到单独的目录中,然后在 MATLAB 命令行中从此目录中键入 myLabel。 myLabel...
myLabel是用于在MATLAB环境中对图像序列进行手动和半自动像素级标记的图形工具。 myLabel 的主要特点: - 类似项目的国家支持。 每个状态由图像列表和所有目录设置组成。 - 任意图像的分辨率(即使在一种状态下)和...
MY LABEL简易A4分割标签制作软件,软件内预定了多个A4分割标签模版,可以直接使用。
<%@Register TagPrefix="snowy" NameSpace="snowy" Assembly="MyLabel" %> <title>My Label Test Page public void OnClick(object sender, EventArgs e) { Label1.Text = "You clicked MyLabel control"; ...
Label MyLabel = new Label(); MyLabel.AutoSize = true; MyForm.Controls.Add(MyLabel); MyLabel.Text = "这就是帮助文档的内容。"; this.AddOwnedForm(MyForm); MyForm.Show(); hlpevent.Handled = true; ...
label单行 高度不变 宽度动态改变
void Page_Load(object ... myLabel.Text = "连接到 Oracle 数据库"; } catch(Exception ex) { myLabel.Text = ex.ToString(); } finally { oConnection.Close(); } }
JavaGUI编程实现的计算器,代码描述文章地址:https://blog.csdn.net/Onlyone_1314/article/details/110929205。...**MyLabel.java** /** *显示计算器按钮运算更新后的文本 */ **Test.java** /** *运行计算器 */
lab.Name = "MyLabel"; lab.Text = string.Format("标签"); lab.Size = new Size(72, 48); lab.Location = new Point(100, 180); this.Controls.Add(lab); #endregion #region//动态添加文本框 ...
<mx:Blur id="numbersBlur" target="{myLabel}" blurYFrom="10.0" blurYTo="0.0" blurXFrom="10.0" blurXTo="0.0" duration="2000"/> 2.效果-滤镜 duration="1500"/> 3.效果-state切换 标签:在变换期间两种效果...
App_Code\ MyLabel.cs 应用视图状态与控件状态。 8-05.aspx 测试控件状态与视图状态。 App_Code\ People.cs 实现记录个人基本信息的自定义控件。 App_Code\ Name.cs Name属性的自定义状态管理类。 第9章(\...
在执行用户查询之前,过滤关键字(创建,删除,索引,合并,设置,唯一),以便用户无法破坏使用扫描的任何内容(在采样阶段,也进行过滤)检查基数=带有唯一标签MATCH的子图集(m:myLabel)使用扫描m:myLabel ...
标签| mylabel-创建一个名为“ mylabel”的标签(转到目标) 转到| mylabel-转到“ mylabel” gotoLabel | mylabel-goto的同义词 gotoIf | expression-如果expression为true,则跳转到指定的标签 当| expres
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 40, 120, 44)]; [self.view addSubview:myLabel]; 二、设置文字 1、设置默认文本 代码如下: NSString *text = @”标签文本”; myLabel.text ...
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 40, 120, 44)]; [self.view addSubview:myLabel]; 二、设置文字 ①、设置默认文本 代码如下: NSString *text = @”标签文本”; myLabel....
如果您希望训练一个类条件模型,则将文件命名为“ mylabel1_XXX.jpg”,“ mylabel2_YYY.jpg”等,以便数据加载器知道“ mylabel1”和“ mylabel2”是标签。 子目录也会自动枚举,因此可以将图像组织为递归结构...