可以通过键盘快捷键更改JTextArea的文本方向吗? [英] Could be Text orientation of JTextArea changed by keyboard shortcut?

查看:122
本文介绍了可以通过键盘快捷键更改JTextArea的文本方向吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JTextArea的组件方向设置为LEFT,因此文本是从左到右书写的.有时,发生在用户书写时,文本方向突然向右更改,因此所有文本都显示为向右对齐. 我无法解释为什么会发生这种情况(我没有用户的直接反馈),但是我猜想,当用户键入内容时,他会激活一些键盘快捷键,该快捷键会更改文本方向. 有人知道这怎么可能吗?还会有其他东西触发文本区域中文本方向的变化吗?

A JTextArea has componenent orientation set to LEFT, so text is written from left to right. Sometimes, it happens that while the user is writing, the text orientation suddenly changes to right, so all the text appears aligned to right. I can't explain why this happens (I have no direct feedback by users), but I guess that, while the user is typing, he activates some keyboard shortcut which changes the text orientation. Does someone know how this can happen? Can be there something else which triggers the change of text orientation in a text area?

推荐答案

Swing具有预定义的键盘快捷键,可在创建挥杆对象时激活.您应该编辑您的键绑定. 本文对您的情况很有用.

Swing has predefined keyboard shortcuts which activates within the creation of swing objects. You should edit your key bindings. This article is useful for your situation.

这篇关于可以通过键盘快捷键更改JTextArea的文本方向吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆