脑梗塞吃什么药| 肚子肥胖是什么原因引起的| 火车头是什么意思| 55岁属什么生肖| 此贝是什么字| 肛门潮湿瘙痒用什么药最好| 鬼剃头是因为什么原因引起的| 草字头加叔念什么| 怀孕有什么现象| 乳酸是什么东西| 丘疹是什么| 羊蝎子是什么肉| 舌系带长有什么影响吗| 泡沫尿是什么原因| 女人经期吃什么食物好| 心脏不好吃什么药最好| 时机是什么意思| 无水乙醇是什么| 电脑关机快捷键是什么| 眼睛经常充血是什么原因引起的| 广角是什么| 海鲜菇不能和什么一起吃| 老虎拉车的歇后语是什么| 白蛋白低吃什么补得快| 什么是三高| 头疼吃什么药最有效| 什么是唐卡| 什么是平衡力| 乌黑对什么| 粘纤是什么材质| 吃秋葵有什么禁忌| 胃酸想吐是什么原因| 五花肉是什么肉| 乳腺导管扩张是什么意思| 什么的工作| 聚宝盆什么意思| 梦到死人是什么预兆| 八面玲珑是指什么生肖| 什么的哲理| 坐东朝西是什么意思| 12月10号是什么星座| 头晃动是什么病的前兆| 头热是什么原因| 梨子和什么一起榨汁好喝| 吃完饭胃疼是什么原因| 葫芦代表什么生肖| 五月二十三日是什么星座| 南辕北辙是什么意思| me是什么基团| 一个虫一个合读什么| 检查梅毒挂什么科| 细小是什么病| 视力模糊是什么原因| 鱼条念什么| 得济是什么意思| 宝宝拉肚子吃什么药| 明五行属什么| 后脑勺疼痛什么原因引起的| 吃什么对胃好养胃的食物| 治疗勃起困难有什么药| 拆骨肉是什么肉| 缺碘会有什么症状| 老年人腿浮肿是什么原因引起的| 考虑是什么意思| 虚心接受是什么意思| 甲状腺是什么原因引起的| nt检查什么| 脾胃阴虚吃什么中成药| 尚书是什么官职| 麻头是什么| 不什么不什么的成语| 金汤是什么汤| 甲醛有什么危害| 五味是什么| 甘油三酯偏高说明什么| 眼皮水肿是什么原因引起的| 山丘是什么意思| 打嗝吃什么药好| 贡菜是什么菜| 牙出血是什么病的前兆| 能人是什么意思| 什么什么美景| 杰克琼斯属于什么档次| 失态是什么意思| 男生喉结不明显是为什么| 情人节送妈妈什么花| 精液是什么| 蜂蜜水什么时候喝比较好| 不明觉厉是什么意思| 甲状腺球蛋白抗体低说明什么| 生菜什么时候种| 同学群取什么名字好| 什么是地中海饮食| 阴茎硬度不够吃什么药| 军衔是什么意思| 下肢水肿是什么原因| 玉米须能治什么病| 杭州菜属于什么菜系| 医保卡是什么| 做梦笑醒了有什么征兆| 铁补多了有什么副作用| 退役和退伍有什么区别| 痰湿中阻吃什么中成药| 金牛男最烦什么女孩| 张学良为什么叫小六子| 月光蓝是什么颜色| 吃什么不升血糖| 打牙祭是什么意思| 颈部ct能检查出什么| 减肥喝什么咖啡| glenfiddich是什么酒| 意向是什么意思| 升阳是什么意思| 总爱放屁是什么原因| 9月14号什么星座| 右眼跳是什么预兆| 干姜和生姜有什么区别| 为什么月经迟迟不来又没怀孕| 心梗做什么手术| 水痘挂什么科| 灵芝孢子粉治什么病| 寡糖是什么| 解脲支原体阳性吃什么药最好| 大便黑色什么原因| 风雨交加是什么生肖| 国师代表什么生肖| 关节炎用什么药最好| 怎么看微信好友什么时候加的| 前夕是什么意思| 精神小伙是什么意思| 婴儿反复发烧是什么原因| 睫毛炎有什么症状| 尿酸高吃什么药最好| 1967属什么生肖| 老上火是什么原因造成的| 闪光点是什么意思| 支原体感染有什么症状| 雪纳瑞什么颜色最贵| 孙悟空最后成了什么佛| 多喝水有什么好处和坏处| 什么什么什么花| 济公是什么生肖| 心脏跳动过快吃什么药| 15是什么意思| 古代质子是什么意思| 建军节是什么时候| 前置胎盘是什么意思| 中老年吃什么钙片比较好| 400能上什么大学| 武松打虎打的是什么虎| 查贫血挂什么科| 三五行属什么| 地球属于什么星系| 全身燥热是什么原因引起的| 静息心率是什么意思| 皮肤爱出油是什么原因| 御字五行属什么| 血热吃什么药好得快| 玄关是什么| 屈服是什么意思| 欣赏一个人是什么意思| alds是什么病| 马上好药膏主治什么| sanag是什么牌子| 光滑念珠菌是什么意思| 胃下垂吃什么药最好| 鹅口疮有什么症状| 汗斑用什么药| 荔枝都有什么品种| 梦见长白头发是什么意思| 维生素B3叫什么名字| 女生安全期什么意思| 顺产1-3天吃什么好| 慢性炎症是什么| 神戳戳是什么意思| 痞块是什么意思| 健康是什么| 玉米什么时候播种| 小猫什么时候断奶| ifa是什么意思| 利涉大川是什么意思| 乳环是什么| 战略支援部队是干什么的| 满人是什么民族| 庚辰五行属什么| 男人下面胀痛什么原因造成呢| 梦见牙掉了一颗是什么意思| 骨髓抑制是什么意思| 悦人不如悦己什么意思| 含漱是什么意思| 飞行模式有什么用| 赤日对什么| 什么虫子咬完是小红点| 淀粉可以用什么代替| 母亲节一般送什么礼物| 马卡龙是什么| 大拇指抖动是什么原因引起的| flour什么意思| 头晕为什么做眼震检查| hcg什么时候查最准确| 甲状腺低回声结节是什么意思| 不敢造次是什么意思| 胃火旺吃什么中成药| 为什么会长汗斑| 庚日是什么意思啊| 听天的动物是什么生肖| 什么样的笑容| 孕妇刚生完孩子吃什么好| 它们是指什么| 吃什么长高| 男人吃荔枝有什么好处| 配偶什么意思| 上房是什么意思| 狮子座跟什么星座最配| 天时地利人和什么意思| 屁股长痘痘是什么原因| 天麻不能和什么一起吃| 心脏官能症吃什么药| 卫生间除臭用什么最好| 12305是什么电话| 突然暴瘦是什么原因| 骑乘是什么意思| 动一下就出汗是什么原因| 三七甘一是什么意思| 鸡肉和什么菜搭配最好| 玉米什么时候传入中国| 卫生院院长是什么级别| 淋巴细胞减少说明什么| 为什么今年夏天特别热| 甲亢什么症状| 脉浮是什么意思| hsv1是什么病毒| 经常吃豆腐有什么好处和坏处| 腰酸是什么病的前兆| 吃什么食物能养肝护肝| 小肚鸡肠是什么意思| 梦见很多牛是什么兆头| 酸是什么意思| 除草剂中毒有什么症状| 8月31日什么星座| 夏天适合喝什么汤| 小肺大泡是什么意思| 男人少精弱精吃什么补最好| 甘油三酯查什么项目| 看眼睛挂什么科| 坐月子哭了会有什么后遗症| 一九九八年属什么生肖| 黄色分泌物是什么原因| abo溶血症是什么意思| 乙肝145阳性是什么意思| 宇字属于五行属什么| 七月初七是什么生肖| 梦见已故的父母是什么兆头| 一个黑一个俊的右边念什么| coupon是什么意思| 甲状腺结节是什么| 高定是什么意思| 世界上最长的蛇是什么蛇| 孩子总爱哭是什么原因| 疣是什么病| 灵枢是什么意思| 角瓜是什么瓜| 人巨细胞病毒是什么病| 鹅口疮有什么症状| 百度Jump to content

【存照】武打明星的高代价:李连杰疾病缠身 吴京曾断手脑震荡

From Wikipedia, the free encyclopedia
百度 进一步讲,要看在坚持党要管党、全面从严治党,以及落实党风廉政建设和反腐败工作方面尽了哪些责、做了哪些事,要问一问为什么单位会发生违纪违法典型案件?二是从领导层面看管理效果。

Windows form with some AWT examples

The Abstract Window Toolkit (AWT) is Java's original platform-dependent windowing, graphics, and user-interface widget toolkit, preceding Swing. The AWT is part of the Java Foundation Classes (JFC) — the standard API for providing a graphical user interface (GUI) for a Java program.[1] AWT is also the GUI toolkit for a number of Java ME profiles. For example, Connected Device Configuration profiles require Java runtimes on mobile telephones to support the Abstract Window Toolkit.

History

[edit]

When Sun Microsystems first released Java in 1995, AWT widgets provided a thin level of abstraction over the underlying native user-interface. For example, creating an AWT check box would cause AWT directly to call the underlying native subroutine that created a check box. However, the check box on Windows is not the same as the check box on macOS or on the various types of Unix. Some application developers prefer this model because it provides a high degree of fidelity to the underlying native windowing toolkit and seamless integration with native applications. In other words, a GUI program written using AWT looks like a native Microsoft Windows application when run on Windows, but the same program looks like a native Apple Macintosh application when run on a Mac, etc. However, some application developers dislike this model because they prefer their applications to look exactly the same on every platform.

In J2SE 1.2, the Swing toolkit largely superseded the AWT's widgets. In addition to providing a richer set of UI widgets, Swing draws its own widgets (by using Java 2D to call into low-level subroutines in the local graphics subsystem) instead of relying on the operating system's high-level user interface module. Swing provides the option of using either the native platform's "look and feel" or a cross-platform look and feel (the "Java Look and Feel") that looks the same on all windowing systems.

Architecture

[edit]

The AWT provides two levels of APIs:

AWT also makes some higher level functionality available to applications, such as:

Neither AWT nor Swing is inherently thread safe. Therefore, code that updates the GUI or processes events should execute on the Event dispatching thread. Failure to do so may result in a deadlock or race condition. To address this problem, a utility class called SwingWorker allows applications to perform time-consuming tasks following user-interaction events in the event dispatching thread.

Mixing AWT and Swing components

[edit]

Where there is a Swing version of an AWT component it will begin with J- and should be used exclusively, replacing the AWT version. For example, in Swing, only use JButton, never Button class. As mentioned above, the AWT core classes, such as Color and Font, are still used as-is in Swing.

When drawing in Swing, use JPanel and override paintComponent(Graphics g) instead of using the AWT paint() methods.

Before Java 6 Update 12, mixing Swing components and basic AWT widgets often resulted in undesired side effects, with AWT widgets appearing on top of the Swing widgets regardless of their defined z-order. This problem was because the rendering architecture of the two widget toolkits was very different, despite Swing borrowing heavyweight top containers from AWT.[2]

Starting in Java 6 Update 12, it is possible to mix Swing and AWT widgets without having z-order problems.[3]

Example

[edit]
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class MyApp {

    public static void main(String[] args) {
        Frame frame = new Frame("Application");
        
        frame.add(new Label("Hello!"));
        frame.setSize(500, 500);
        frame.setLocationRelativeTo(null); // Centers the window
        
        frame.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                frame.dispose(); // Releases native screen resources
            }
        });
        
        frame.setVisible(true);
    }
}

Implementation

[edit]

As the AWT is a bridge to the underlying native user-interface, its implementation on a new operating system may involve a lot of work, especially if it involves any of the AWT GUI widgets, because each of them requires that its native peers be developed from scratch.

A new project, Caciocavallo, has been created, that provides an OpenJDK-based Java API to ease AWT implementation on new systems.[4][5] The project has successfully implemented AWT widgets using Java2D.[6] All the necessary core-JDK modifications have since been pushed to OpenJDK 7,[7] which means that Java can now be used on a graphics stack other than one of those provided by the official JDK (X Window System, OpenGL or DirectX), by including an external library and setting some system properties. A DirectFB backend for Caciocavallo[8] is under development, as is an HTML5 backend; the aim is to deploy existing Swing applications—without Java support—as ordinary web applications running on a web server.[8][9]

See also

[edit]

References

[edit]
  1. ^ This article is based on material taken from Abstract+Window+Toolkit at the Free On-line Dictionary of Computing prior to 1 November 2008 and incorporated under the "relicensing" terms of the GFDL, version 1.3 or later.
  2. ^ Fowler, Amy (1994). "Mixing heavy and light components". Sun Microsystems. Archived from the original on 23 December 2011. Retrieved 17 December 2008.
  3. ^ "Bug/RFE fixed in current JDK 6u12 build". Sun Microsystems. 12 December 2008. Archived from the original on 17 December 2008. Retrieved 17 December 2008.
  4. ^ Torre, Mario (2 March 2008). "FINAL PROPOSAL: Portable GUI backends". Archived from the original on 19 March 2012. Retrieved 7 September 2008.
  5. ^ Kennke, Roman (18 December 2008). "Caciocavallo Architecture Overview". Retrieved 7 September 2008.
  6. ^ Kennke, Roman (3 September 2008). "Cacio Swing AWT peers". Archived from the original on 13 March 2012. Retrieved 7 September 2008.
  7. ^ "How much has been pushed upstream?". openjdk.java.net. 20 September 2009. Archived from the original on 19 March 2012. Retrieved 7 March 2010. You don't need anymore of those patches, with the latest FontManager push, everything is upstream now, so just use the Cacio repo, it's completely self contained.
  8. ^ a b Kennke, Roman (28 July 2011). "JDK7 and Cacio coolness". Retrieved 8 August 2011.
  9. ^ Eisserer, Clemens. "HTML5/Canvas backend for Caciocavallo (GNU-Classpath)". Archived from the original on 21 March 2012. Retrieved 8 August 2011.
[edit]
闰六月是什么意思 为什么女的会流水怎么回事 济公原名叫什么 鼻子有痣代表什么 结婚13年是什么婚
腋毛癣用什么药膏 伤口吃什么消炎药 asmr是什么 Urea医学上是什么意思 深紫色配什么颜色好看
灵芝孢子粉是什么 七月是什么星座 脚长水泡是什么原因 刑警队是干什么的 航五行属什么
盆腔炎有什么症状 喝酒吃头孢有什么反应 三八送什么花 尿等待是什么原因 ins是什么
做梦梦见火是什么意思hcv7jop6ns6r.cn 学考成绩什么时候公布hcv8jop3ns1r.cn 腮帮子长痘痘是什么原因hcv8jop1ns3r.cn 看淡一切对什么都没兴趣hcv8jop1ns6r.cn 拔牙有什么危害hcv7jop5ns0r.cn
尿毒症有什么症状hcv9jop5ns1r.cn 吕布为什么叫三姓家奴hcv9jop8ns0r.cn ercp是什么hcv8jop1ns2r.cn 舌头痒痒的是什么原因hcv8jop5ns9r.cn 女生送男生什么礼物好hcv9jop0ns8r.cn
闰月鞋买什么颜色bysq.com 承上启下是什么意思hcv9jop6ns0r.cn 什么地hcv8jop5ns0r.cn 心脏缺血吃什么药好hcv8jop2ns0r.cn 本性难移是什么生肖hcv8jop1ns8r.cn
纸醉金迷什么意思hcv8jop4ns6r.cn 纾字五行属什么hcv9jop3ns6r.cn 心脏造影是什么hcv9jop3ns5r.cn 验孕棒什么时候测hcv9jop5ns3r.cn 有什么奇怪tiangongnft.com
百度