|
|
|
JDialog
|
|||
|---|---|---|---|
|
#18+
Есть фрейм. В нем я вывожу диалоговое окно. Как вывести фрейм в центр экрана я знаю. А как JDialog вывести в центр фрейма? Не получается...Окно JDialog выводится в позицию с координатами (0;0). ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.09.2005, 16:02 |
|
||
|
JDialog
|
|||
|---|---|---|---|
|
#18+
зависит от испольpeго layout-а. Юзай BorderLayout. http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.09.2005, 16:05 |
|
||
|
JDialog
|
|||
|---|---|---|---|
|
#18+
Naugзависит от испольpeго layout-а. Юзай BorderLayout. http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html а чего, правда, что положение диалога над окном, зависит от layout'a родительского окна ? :) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.09.2005, 16:10 |
|
||
|
JDialog
|
|||
|---|---|---|---|
|
#18+
Может и нет. Может я что такое JDialog не знаю ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.09.2005, 16:14 |
|
||
|
JDialog
|
|||
|---|---|---|---|
|
#18+
Naugзависит от испольpeго layout-а. Юзай BorderLayout. http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98. 99. 100. 101. 102. 103. 104. 105. 106. 107. 108. 109. 110. 111. 112. 113. 114. 115. 116. 117. 118. 119. 120. 121. 122. 123. 124. 125. 126. 127. 128. 129. 130. 131. 132. 133. 134. 135. 136. 137. 138. 139. 140. 141. 142. 143. 144. 145. 146. 147. 148. 149. 150. 151. 152. 153. 154. 155. 156. 157. 158. 159. 160. 161. 162. 163. 164. 165. 166. 167. 168. 169. 170. 171. 172. 173. 174. 175. 176. 177. 178. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.09.2005, 16:17 |
|
||
|
JDialog
|
|||
|---|---|---|---|
|
#18+
авторsetBounds public void setBounds(int x, int y, int width, int height)Description copied from class: Component Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height. Overrides: setBounds in class Component Parameters: x - the new x-coordinate of this component y - the new y-coordinate of this component width - the new width of this component height - the new height of this component Например с помощью этого метода. Т. е. получаешь положение и размеры своего фрейма. Далее берешь размер своего диалога, ну и высчитываешь и задаешь положение и размер диалога. В общем смотри класс java.awt.Window и ищи нужные тебе методы. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.09.2005, 16:25 |
|
||
|
JDialog
|
|||
|---|---|---|---|
|
#18+
GMax авторsetBounds public void setBounds(int x, int y, int width, int height)Description copied from class: Component Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height. Overrides: setBounds in class Component Parameters: x - the new x-coordinate of this component y - the new y-coordinate of this component width - the new width of this component height - the new height of this component Например с помощью этого метода. Т. е. получаешь положение и размеры своего фрейма. Далее берешь размер своего диалога, ну и высчитываешь и задаешь положение и размер диалога. В общем смотри класс java.awt.Window и ищи нужные тебе методы. Спасибо за идею. Вот что получилось: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 13.09.2005, 16:54 |
|
||
|
|

start [/forum/topic.php?fid=59&msg=33266994&tid=2151506]: |
0ms |
get settings: |
11ms |
get forum list: |
17ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
154ms |
get topic data: |
12ms |
get forum data: |
2ms |
get page messages: |
63ms |
get tp. blocked users: |
1ms |
| others: | 233ms |
| total: | 501ms |

| 0 / 0 |
