1、EXCEPTION_ACCESS_VIOLATION
#
# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x69f4b686, pid=400, tid=5828
#
# Java VM: Java HotSpot(TM) Client VM (11.3-b02 mixed mode windows-x86)
# Problematic frame:
# C [atioglxx.dll+0xf1b686]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
这是指你去碰了不该碰的东西,越界了,也就是说在一个非UI线程去操作了UI线程。因为,SWT 在底层设计时不允许其他的线程访问 UI 线程,这样你就犯错了,所以在使用UI线程时要加上一句
swtShell.getDisplay().asyncExec(new Runnable() { public void run() { updateAssets((Map<String, MonitorObject>) peoples); } });
已有 0 人发表留言,猛击->>这里<<-参与讨论
ITeye推荐
- —软件人才免语言低担保 赴美带薪读研!—
1.初始化textfield并设置位置及大小
UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)];
2.设置输入框内容的字体样式和大小,字体颜色,对齐方式
text.font = [UIFont fontWithName:@"Arial" size:20.0f];
text.textColor = [UIColor redColor];
text.text = @"输入框默认文字";
text.textAlignment = UITextAlignmentLeft;
3.设置边框样式,只有设置了才会显示边框样式
text.borderStyle = UITextBorderStyleRoundedRect;
typedef enum {
UITextBorderStyleNone,
UITextBorderStyleLine,
UITextBorderStyleBezel,
UITextBorderStyleRoundedRect
} UITextBorderStyle;
4.设置输入框的背景颜色,此时设置为白色 如果使用了自定义的背景图片边框会被忽略掉
text.backgroundColor = [UIColor whiteColor];
5.设置背景图片text.background = [UIImage imageNamed:@"dd.png"];
6.设置选中背景图片
text.disabledBackground = [UIImage imageNamed:@"cc.png"];
在Notes开发中,有时会需要在月份的数字和名称之间相互转换。因为仅仅涉及到月份,用Format和DateValue函数并不方便。我们可以编写一个实用的类来解决这个问题。
%REM Class MonthConverter Description: Comments for Class %END REM Public Class MonthConverter Private num2Name As NArray Private num2FName As NArray Private name2Num As Dictionary Private fname2Num As Dictionary %REM Sub New Description: Comments for Sub %END REM Sub New() 'initialize num2Fname Set me.num2FName=New NArray(11) With me.num2FName Call .Add("January") Call .Add("February") Call .Add("March") Call .Add("April") Call .Add("May") Call .Add("June") Call .Add("July") Call .Add("August") Call .Add("September") Call .Add("October") Call .Add("November") Call .Add("December") End With 'initialize num2Name Set me.num2Name=New NArray(11) Dim i As Integer For i=0 To 11 Call me.num2Name.Add(Left(me.num2FName.Container(i), 3)) Next 'initialize fname2Num Set me.fname2Num=New Dictionary() For i=0 To 11 Call me.fname2Num.Add(CStr(me.num2FName.Container(i)), i) Next 'initialize name2Num Set me.name2Num=New Dictionary() For i=0 To 11 Call me.name2Num.Add(CStr(me.num2Name.Container(i)), i) Next End Sub %REM Function GetName Description: Comments for Function %END REM Public Function GetName(num As Integer) As String If num<1 Or num>12 Then Exit Function End If me.GetName=me.num2Name.Container(num-1) End Function %REM Function GetFullName Description: Comments for Function %END REM Public Function GetFullName(num As Integer) As String If num<1 Or num>12 Then Exit Function End If me.GetFullName=me.num2FName.Container(num-1) End Function %REM Function GetNum Description: Comments for Function %END REM Public Function GetNum(monthName As String) As Integer Dim num num=me.name2Num.Item(monthName) If IsEmpty(num) Then num=me.fname2Num.Item(monthName) End If If Not IsEmpty(num) Then me.GetNum=num End If End Function End Class
GetName方法将月份数字转换成三字母缩写的月份名称。GetFullName方法将月份数字转换成英文月份名称。GetNum方法将月份名城转换成月份数字。其中用到的Dictionary和NArray在之前的面向对象的LotusScript的系列文章中都已经给出了。