بازگشت   پی سی سیتی > کامپیوتر اینترنت و شبکه Computer internet > سیستم عامل > ویندوز windows > مقالات آموزش ترفندها... Traning > مقایسه ها > برنامه های کاربردی

پاسخ
 
ابزارهای موضوع نحوه نمایش
  #1  
قدیمی 06-27-2013
DifferenceBetween آواتار ها
DifferenceBetween DifferenceBetween آنلاین نیست.
ربات اتوماتیک
 
تاریخ عضویت: May 2013
نوشته ها: 108
سپاسها: : 0

0 سپاس در 0 نوشته ایشان در یکماه اخیر
پیش فرض مقایسه تفاوت های Difference Between jtextpane and jtextarea

مقایسه تفاوت های Difference Between jtextpane and jtextarea

JTextPane vs JEditorPane

It is important to acknowledge the basic functions of JTextPane and Jtextarea prior to discussing on the similarities and differences between the two. JTextPane and JEditorPane are both derivatives of  javax.swing.text.JTextComponent, with  JTextPane coming as a subclass of JEditorPane. From this, it is safe to conclude that JTextPane is a specialized form of JEditorPane which comes with some extra functionality.

JTextArea comes with specific functions; one of these prevents it from wrapping text whenever the text is put in. This in effect means that in the event that text is placed in it, it is automatically assigned to the left side and goes this way until you press enter.

JTextPane on the other hand comes with the wrap text feature. This helps in creating boundaries within the text field. When a letter reaches the boundary, it will automatically start off the next line as opposed to the view that is shown by JTextArea.

To make JTextArea work the same as JTextPane, implementation of text wrap in JTextArea has been shown to allow automatic sentence starting on a new line when the preceding line reaches the boundary. This is one of the main differences. To make this possible JTextArea makes use of set setLineWrap(..) and setWrapStyleWord(..) It is possible to control the manner in which text wrapping is done.

Another difference is that JTextPane has word/paragraph styling capabilities and allows for embedding of images that is done within a single document. This capability differs from those of JTextArea, which cannot allow for the editing of pictures within a single document.

It has also been shown that JTextPane supports editing of content entered, a feature that is not available in JTextArea, even after the warping feature has been instituted. Among the editing features that JTextPane allows for are underlining, bolding of content and coloring of text.

The limitation that prevents JTextPane from being the preferred choice over JTextArea is that JTextPane is very heavy when it comes to component use. It is therefore advisable to employ JTextArea, which employs text warping feature if there is no need to edit content by underlining it, making it bold or coloring it. This is because using JTextPane and not employing any of the styling feature results in a significant slowing down of the user interface.  This also causes more memory from the system to be allocated to JTextPane unnecessarily.  For a good lightweight build program that is easy on the system, only requiring minimal input, it is advisable to go for JTextArea, as it has been shown to run well on user interfaces, without being demanding of resources.

Due to the huge flexibility that JTextPane offers and the resources that it demands from the operating system, it means that more programming is required to be carried out prior to its use. A great feature that JTextPane offers that is not available in JTextArea is that it allows for editor panes to be easily loaded together with formatted text that comes from the URL. This is a quite important feature as it allows for the display of un-editable help information.

Summary

JTextPane is a derivative of  javax.swing.text.JTextComponent.

JTextArea cannot warp text.

JTextPane comes with the possibility of text warping

JTextArea can warp text using setLineWrap(..) and setWrapStyleWord(..)

JTextPane is resource heavy while JTextArea is resource limiting

For faster implementations, JTextArea ought to be used

JTextPane ought to be used only when styling is required on the project at hand

JTextPane needs more programming when compared to using JTextArea

JTextPane allows for image embedding while JTextArea does not allow for the embedding of images



You might also like…



پاسخ با نقل قول
جای تبلیغات شما اینجا خالیست با ما تماس بگیرید




پاسخ


کاربران در حال دیدن موضوع: 1 نفر (0 عضو و 1 مهمان)
 

مجوز های ارسال و ویرایش
شما نمیتوانید موضوع جدیدی ارسال کنید
شما امکان ارسال پاسخ را ندارید
شما نمیتوانید فایل پیوست در پست خود ضمیمه کنید
شما نمیتوانید پست های خود را ویرایش کنید

BB code is فعال
شکلک ها فعال است
کد [IMG] فعال است
اچ تی ام ال غیر فعال می باشد



اکنون ساعت 09:05 PM برپایه ساعت جهانی (GMT - گرینویچ) +3.5 می باشد.



Powered by vBulletin® Version 3.8.4 Copyright , Jelsoft Enterprices مدیریت توسط کورش نعلینی
استفاده از مطالب پی سی سیتی بدون ذکر منبع هم پیگرد قانونی ندارد!! (این دیگه به انصاف خودتونه !!)
(اگر مطلبی از شما در سایت ما بدون ذکر نامتان استفاده شده مارا خبر کنید تا آنرا اصلاح کنیم)


سایت دبیرستان وابسته به دانشگاه رازی کرمانشاه: کلیک کنید




  پیدا کردن مطالب قبلی سایت توسط گوگل برای جلوگیری از ارسال تکراری آنها