What is the difference between frame and null in showMessageDialog in Java?

nbdip

Say i have an object of the JFrame class as frame

I was wondering what is the difference between

JOptionPane.showMessageDialog(null,message) 

and

JOptionPane.showMessageDialog(frame,message)

to print something out.Both give the same result and they pop up at the same place.So i was wondering what is really the difference between these two? What happens actually in background differently?

pundit

When providing the frame or any other component the option pane will pop up at the middle of the component. However if you are providing null then it will pop up at the middle of your screen.

In your case I guess your Jframe is of your screen size. So if you reduce your frame size and start it at the default location i.e top left corner then you may see the difference.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

What is difference between null and empty list?

分類Dev

Difference between @($null) and $null

分類Dev

What is the difference between Spark Serialization and Java Serialization?

分類Dev

What is the difference between string.Empty and null in memory

分類Dev

Difference Between MySql <> NULL and IS NOT NULL

分類Dev

What is the difference between * and *|* in CSS?

分類Dev

What's the difference between "as?", "as!", and "as"?

分類Dev

What is the difference between [ ] and [[ ]] in R?

分類Dev

What is the difference between these macros?

分類Dev

What is the difference between . and ./ in bash?

分類Dev

What is the difference between "not ==" and "!="?

分類Dev

What is the difference between //*[*] and //*[.] in XPath?

分類Dev

What is the difference between $* and $@?

分類Dev

What is the difference between (.*?) and (.*)? in regex?

分類Dev

In Java, what is the difference between the global logger and the root logger?

分類Dev

What is the difference between no access specifier and public in java 9 module?

分類Dev

What's the difference between C++ Concept and Java Interface?

分類Dev

What is the difference between Hibernate and Suspend

分類Dev

What is the difference between (a != b) and (a != (a = b)?

分類Dev

What is the difference between compileSdkVersion and targetSdkVersion?

分類Dev

What is the difference between resource and endpoint?

分類Dev

What is the difference between ServerSockets and Websockets?

分類Dev

What it the difference between Hbase and BigTable?

分類Dev

What is the difference between glBufferStorage and glBufferData?

分類Dev

What is the difference between this, getContext() and getActivity()?

分類Dev

What is the difference between a Pane and a Group?

分類Dev

What is the difference between count and sizeof?

分類Dev

What is the difference between RACSequence and RACSignal

分類Dev

What is the difference between OpenERP and Odoo?

Related 関連記事

  1. 1

    What is difference between null and empty list?

  2. 2

    Difference between @($null) and $null

  3. 3

    What is the difference between Spark Serialization and Java Serialization?

  4. 4

    What is the difference between string.Empty and null in memory

  5. 5

    Difference Between MySql <> NULL and IS NOT NULL

  6. 6

    What is the difference between * and *|* in CSS?

  7. 7

    What's the difference between "as?", "as!", and "as"?

  8. 8

    What is the difference between [ ] and [[ ]] in R?

  9. 9

    What is the difference between these macros?

  10. 10

    What is the difference between . and ./ in bash?

  11. 11

    What is the difference between "not ==" and "!="?

  12. 12

    What is the difference between //*[*] and //*[.] in XPath?

  13. 13

    What is the difference between $* and $@?

  14. 14

    What is the difference between (.*?) and (.*)? in regex?

  15. 15

    In Java, what is the difference between the global logger and the root logger?

  16. 16

    What is the difference between no access specifier and public in java 9 module?

  17. 17

    What's the difference between C++ Concept and Java Interface?

  18. 18

    What is the difference between Hibernate and Suspend

  19. 19

    What is the difference between (a != b) and (a != (a = b)?

  20. 20

    What is the difference between compileSdkVersion and targetSdkVersion?

  21. 21

    What is the difference between resource and endpoint?

  22. 22

    What is the difference between ServerSockets and Websockets?

  23. 23

    What it the difference between Hbase and BigTable?

  24. 24

    What is the difference between glBufferStorage and glBufferData?

  25. 25

    What is the difference between this, getContext() and getActivity()?

  26. 26

    What is the difference between a Pane and a Group?

  27. 27

    What is the difference between count and sizeof?

  28. 28

    What is the difference between RACSequence and RACSignal

  29. 29

    What is the difference between OpenERP and Odoo?

ホットタグ

アーカイブ